Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f0af1ac
[ADD][8.0] base_custom_info: Init develop
carlosdauden Dec 4, 2015
b0fa518
[IMP][8.0] base_custom_info: Actions and menus. Refactor strings Info…
carlosdauden Dec 11, 2015
e77053b
[FIX][8.0] base_custom_info: Minor fix and security
carlosdauden Dec 11, 2015
fcb431a
Fix many bugs and styling, and prepare for OCA.
yajo Dec 15, 2015
6e0fd03
[9.0][MIG][base_custom_info] Migration.
yajo May 26, 2016
64464de
[FIX] remove en.po that was erroneously created by transbot
sbidoul Aug 15, 2016
ebef19f
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
1fec229
[CHG] base_custom_info: Relicense to LGPL with all authors' consent
yajo Aug 3, 2016
2318a64
[IMP]base_custom_info: New types and access rules system.
yajo Aug 3, 2016
bb0cfcf
[FIX] base_custom_info: fix demo template csv
sergio-teruel Apr 3, 2017
c0e5921
[FIX][base_custom_info] Make tests work
yajo May 29, 2017
74c1cc3
[MIG] [10.0] base custom info
fanha99 May 29, 2017
79e1a79
[FIX] base_custom_info: Check contrain on model into template before …
lmignon Sep 10, 2019
7217b93
base_custom_info 10.0.1.1.0
OCA-git-bot Sep 10, 2019
1aa1892
[MIG] base_custom_info: Migration to 12.0
Tardo Nov 8, 2019
29d1d7b
[MIG][FIX] base_custom_info: Several adjustments:
pedrobaeza Dec 5, 2019
ab5b339
[IMP] base_custom_info: Tests
Tardo Dec 16, 2019
3b961ab
[UPD] Update base_custom_info.pot
oca-travis Dec 18, 2019
44e396d
[12.0][FIX] base_custom_info
AdriaGForgeFlow Dec 19, 2019
0dfa356
[IMP] base_custom_info: black, isort, prettier
dalonsod May 18, 2020
58078c9
[MIG] base_custom_info: Migration to 13.0
dalonsod May 18, 2020
31af23e
[MIG v13.0] base_custom_info: fix tests
Sep 15, 2020
94b4723
[MIG] base_custom_info: Migration to 13.0 - added #1844 improvements …
dalonsod Dec 23, 2020
840baa4
[UPD] Update base_custom_info.pot
oca-travis Jan 21, 2021
b7c3027
[UPD] README.rst
OCA-git-bot Jan 21, 2021
e3cc68a
Translated using Weblate (Spanish)
anasuarez1 Mar 19, 2021
d12e884
[IMP] base_custom_info: enable importing custom info values
Rad0van Mar 19, 2021
552a9f6
base_custom_info 13.0.1.0.1
OCA-git-bot Mar 29, 2021
7c95eff
[14.0][IMP] base_custom_info: black, isort, prettier
kittiu Jul 16, 2021
e81c5b1
[14.0][MIG] base_custom_info
kittiu Jul 16, 2021
87e5741
[UPD] Update base_custom_info.pot
oca-travis Dec 11, 2021
df79a32
[UPD] README.rst
OCA-git-bot Dec 11, 2021
5a9ee19
Translated using Weblate (Italian)
francesco-ooops Mar 16, 2022
9d0bf0b
Translated using Weblate (Italian)
francesco-ooops Mar 16, 2022
7acf009
[IMP] update dotfiles
OCA-git-bot Mar 30, 2022
0197cae
[MIG] base_custom_info: Migration to 15.0
Rad0van Jun 15, 2022
10d0db1
[IMP] base_custom_info: only save if data has been modified
etobella Sep 6, 2023
d47eab3
[UPD] Update base_custom_info.pot
Sep 8, 2023
66cdd5e
[UPD] README.rst
OCA-git-bot Sep 8, 2023
ec36093
Update translation files
weblate Sep 8, 2023
fb4247d
Translated using Weblate (Italian)
mymage Sep 20, 2023
0477dd1
Update translation files
weblate Oct 9, 2023
c04c18c
Translated using Weblate (Spanish)
Ivorra78 Oct 12, 2023
ce8a171
Translated using Weblate (Italian)
mymage Nov 6, 2023
90b0180
Translated using Weblate (Italian)
mymage Dec 29, 2023
af9ea4f
Translated using Weblate (Italian)
mymage Oct 2, 2025
62faae6
Translated using Weblate (Italian)
mymage Nov 28, 2025
14fbe8f
Translated using Weblate (Galician)
pcastelovigo May 23, 2026
fdcbadd
[MIG] base_custom_info: Migration to 16.0
rrajasree Jul 17, 2026
24ecb72
[MIG] base_custom_info: Migration to 16.0
rrajasree Jul 17, 2026
2b876e0
[MIG] base_custom_info: Migration to 16.0
rrajasree Jul 17, 2026
e8882e1
[MIG] base_custom_info: Migration to 16.0
rrajasree Jul 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
295 changes: 295 additions & 0 deletions base_custom_info/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

================
Base Custom Info
================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a4a70fea9e6d3bc5c8fce48712897597ae49b8f89e44b1b77e614e9947926f35
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/16.0/base_custom_info
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_custom_info
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to attach custom information to records without the need
to alter the database structure too much.

This module defines several concepts that you have to understand.

Templates
---------

A *template* is a collection of *properties* that a record should have.
*Templates* always apply to a given model, and then you can choose among the
current templates for the model you are using when you edit a record of that
model.

I.e., This addon includes a demo template called "Smart partners", that applies
to the model ``res.partner``, so if you edit any partner, you can choose that
template and get its properties autofilled.

Properties
----------

A *property* is the "name" of the field. *Templates* can have any amount of
*properties*, and when you apply a *template* to a record, it automatically
gets all of its *properties* filled, empty (unless they have a *Default
value*), ready to assign *values*.

You can set a property to as *required* to force it have a value, although you
should keep in mind that for yes/no properties, this would mean that only *yes*
can be selected, and for numeric properties, zero would be forbidden.

Also you can set *Minimum* and *Maximum* limits for every *property*, but those
limits are only used when the data type is text (to constrain its length) or
number. To skip this constraint, just set a maximum smaller than the minimum.

*Properties* always belong to a template, and as such, to a model.

*Properties* define the data type (text, number, yes/no...), and when the type
is "Selection", then you can define what *options* are available.

I.e., the "Smart partners" *template* has the following *properties*:

- Name of his/her teacher
- Amount of people that hates him/her for being so smart
- Average note on all subjects
- Does he/she believe he/she is the smartest person on earth?
- What weaknesses does he/she have?

When you set that template to any partner, you will then be able to fill these
*properties* with *values*.

Categories
----------

*Properties* can also belong to a *category*, which allows you to sort them in
a logical way, and makes further development easier.

For example, the ``website_sale_custom_info`` addon uses these to display a
technical datasheet per product in your online shop, sorted and separated by
category.

You are not required to give a *category* to every *property*.

Options
-------

When a *property*'s type is "Selection", then you define the *options*
available, so the *value* must be one of these *options*.

I.e., the "What weaknesses does he/she have?" *property* has some options:

- Loves junk food
- Needs videogames
- Huge glasses

The *value* will always be one of these.

Value
-----

When you assign a *template* to a partner, and then you get the *properties* it
should have, you still have to set a *value* for each property.

*Values* can be of different types (whole numbers, constrained selection,
booleans...), depending on how the *property* was defined. However, there is
always the ``value`` field, that is a text string, and converts automatically
to/from the correct type.

Why would I need this?
~~~~~~~~~~~~~~~~~~~~~~

Imagine you have some partners that are foreign, and that for those partners
you need some extra information that is not needed for others, and you do not
want to fill the partners model with a lot of fields that will be empty most of
the time.

In this case, you could define a *template* called "Foreign partners", which
will be applied to ``res.partner`` objects, and defines some *properties* that
these are expected to have.

Then you could assign that *template* to a partner, and automatically you will
get a subtable of all the properties it should have, with tools to fill their
*values* correctly.

Does this work with any model?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Yes and no.

Yes, because this is a base module that provides the tools to make this work
with any model.

No, because, although the tools are provided, they are only applied to the
``res.partner`` model. This is by design, because different models can have
different needs, and we don't want to depend on every possible model.

So, if you want to apply this to other models, you will have to develop a
little additional addon that depends on this one. If you are a developer, refer
to the *Development* section below.

**Table of contents**

.. contents::
:local:

Installation
============

This module serves as a base for other modules that implement this behavior in
concrete models.

This module is a technical dependency and is to be installed in parallel to
other modules.

Configuration
=============

To enable the main *Custom Info* menu:

#. Enable *Settings > General Settings > Manage custom information*.

To enable partner's custom info tab:

#. Enable *Settings > General Settings > Edit custom information in partners*.

Usage
=====

This module defines *Custom Info Templates* that define what properties are
expected for a given record.

To define a template, you need to:

* Go to *Custom Info > Templates*.
* Create one.
* Add some *Properties* to it.

All database records with that template enabled will automatically fill those
properties.

To manage the properties, you need to:

* Go to *Custom Info > Properties*.

To manage the property categories, you need to:

* Go to *Custom Info > Categories*.

Some properties can have a number of options to choose, to manage them:

* Go to *Custom Info > Options*.

To manage their values, you need to:

* Go to *Custom Info > Values*.

Development
===========

To create a module that supports custom information, just depend on this module
and inherit from the ``custom.info`` model.

See an example in the ``product_custom_info`` addon.

Known issues / Roadmap
======================

* Custom properties cannot be shared among templates.
* Required attributes are for now only set in the UI, not in the ORM itself.
* Support recursive templates using options

.. figure:: https://raw.githubusercontent.com/base_custom_info/static/description/customizations-everywhere.jpg
:alt: Customizations Everywhere

If you assign an *additional template* to an option, and while using the owner
form you choose that option, you can then press *reload custom information
templates* to make the owner update itself to include all the properties in all
the involved templates. If you do not press the button, anyway the reloading
will be performed when saving the owner record.

.. figure:: https://raw.githubusercontent.com/base_custom_info/static/description/templateception.jpg
:alt: Templateception

I.e., if you select the option "Needs videogames" for the property "What
weaknesses does he/she have?" of a smart partner and press *reload custom
information templates*, you will get 2 new properties to fill: "Favourite
videogames genre" and "Favourite videogame".

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_custom_info%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`__:

* Rafael Blasco <rafael.blasco@tecnativa.com>
* Carlos Dauden <carlos.dauden@tecnativa.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Alexandre Díaz <alexandre.diaz@tecnativa.com>
* Creu Blanca:

* Enric Tobella <etobella@creublanca.es>
* Solvos:

* David Alonso <david.alonso@solvos.es>
* Ecosoft:

* Kitti U. <kittiu@ecosoft.co.th> (migration to v14)

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/16.0/base_custom_info>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions base_custom_info/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2015 Antiun Ingeniería S.L. - Sergio Teruel
# Copyright 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html

from . import models, wizard
52 changes: 52 additions & 0 deletions base_custom_info/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2015 Antiun Ingeniería S.L. - Sergio Teruel
# Copyright 2015 Antiun Ingeniería S.L. - Carlos Dauden
# Copyright 2015-2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html

{
"name": "Base Custom Info",
"summary": "Add custom field in models",
"category": "Tools",
"version": "16.0.1.0.0",
"depends": ["base_setup"],
"data": [
"security/ir.model.access.csv",
"security/res_groups_security.xml",
"views/custom_info_category_view.xml",
"views/custom_info_option_view.xml",
"views/custom_info_template_view.xml",
"views/custom_info_property_view.xml",
"views/custom_info_value_view.xml",
"views/menu.xml",
"views/res_partner_view.xml",
"wizard/res_config_settings_view.xml",
],
"assets": {
"web.assets_qweb": ["base_custom_info/static/src/xml/custom_info_item.xml"],
"web.assets_backend": [
"base_custom_info/static/src/js/custom_info_renderer.js",
"base_custom_info/static/src/js/custom_info_view.js",
"base_custom_info/static/src/js/relational_fields.js",
"base_custom_info/static/src/scss/custom_info.scss",
],
},
"demo": [
"demo/custom.info.category.csv",
"demo/custom.info.template.csv",
"demo/custom.info.property.csv",
"demo/custom.info.option.csv",
"demo/res_groups.xml",
"demo/defaults.xml",
],
"images": [
"images/menu.png",
"images/properties.png",
"images/templates.png",
"images/values.png",
],
"author": "Tecnativa,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-tools",
"license": "LGPL-3",
"application": True,
"installable": True,
}
3 changes: 3 additions & 0 deletions base_custom_info/demo/custom.info.category.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,sequence
cat_statics,Statistics,50
cat_gaming,Gaming,100
10 changes: 10 additions & 0 deletions base_custom_info/demo/custom.info.option.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
id,name,property_ids:id,template_id:id
opt_food,Loves junk food,prop_weaknesses,
opt_videogames,Needs videogames,prop_weaknesses,tpl_gamer
opt_glasses,Huge glasses,prop_weaknesses,
opt_shooter,Shooter,prop_fav_genre,
opt_platforms,Platforms,prop_fav_genre,
opt_cars,Cars,prop_fav_genre,
opt_rpg,RPG,prop_fav_genre,
opt_strategy,Strategy,prop_fav_genre,
opt_graphical_adventure,Graphical adventure,prop_fav_genre,
9 changes: 9 additions & 0 deletions base_custom_info/demo/custom.info.property.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
id,name,template_id:id,widget,required,minimum,maximum,category_id:id,sequence
prop_teacher,Name of his/her teacher,tpl_smart,char,,1,30,,100
prop_haters,Amount of people that hates him/her for being so smart,tpl_smart,integer,,0,99999,cat_statics,200
prop_avg_note,Average note on all subjects,tpl_smart,float,True,0,10,cat_statics,300
prop_smartypants,Does he/she believe he/she is the smartest person on earth?,tpl_smart,boolean,,0,-1,,400
prop_weaknesses,What weaknesses does he/she have?,tpl_smart,many2one,,0,-1,,500
prop_fav_genre,Favourite videogames genre,tpl_gamer,many2one,,0,-1,cat_gaming,600
prop_fav_game,Favourite videogame,tpl_gamer,char,,0,-1,cat_gaming,700
prop_buy_fav_game,When Favourite videogame was bought?,tpl_gamer,date,,0,-1,cat_gaming,700
3 changes: 3 additions & 0 deletions base_custom_info/demo/custom.info.template.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model,model_id:id
tpl_smart,Smart partners,res.partner,base.model_res_partner
tpl_gamer,Gamers,res.partner,base.model_res_partner
8 changes: 8 additions & 0 deletions base_custom_info/demo/defaults.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
<odoo>
<record id="prop_weaknesses" model="custom.info.property">
<field name="default_value">Huge glasses</field>
</record>
</odoo>
Loading
Loading