odoo14-addon-base-custom-info


Nameodoo14-addon-base-custom-info JSON
Version 14.0.1.0.3 PyPI version JSON
download
home_pagehttps://github.com/OCA/server-tools
SummaryAdd custom field in models
upload_time2023-10-29 11:44:46
maintainer
docs_urlNone
authorTecnativa,Odoo Community Association (OCA)
requires_python>=3.6
licenseLGPL-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ================
Base Custom Info
================

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

.. |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/licence-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/14.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-14-0/server-tools-14-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=14.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:%2014.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/14.0/base_custom_info>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OCA/server-tools",
    "name": "odoo14-addon-base-custom-info",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Tecnativa,Odoo Community Association (OCA)",
    "author_email": "support@odoo-community.org",
    "download_url": "",
    "platform": null,
    "description": "================\nBase Custom Info\n================\n\n.. \n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! This file is generated by oca-gen-addon-readme !!\n   !! changes will be overwritten.                   !!\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! source digest: sha256:60e569391a9bad69fa5d5fea0b186896af9a0cc4e65486613706cff1223f376e\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n    :target: https://odoo-community.org/page/development-status\n    :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png\n    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html\n    :alt: License: LGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github\n    :target: https://github.com/OCA/server-tools/tree/14.0/base_custom_info\n    :alt: OCA/server-tools\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n    :target: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_custom_info\n    :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png\n    :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=14.0\n    :alt: Try me on Runboat\n\n|badge1| |badge2| |badge3| |badge4| |badge5|\n\nThis module allows you to attach custom information to records without the need\nto alter the database structure too much.\n\nThis module defines several concepts that you have to understand.\n\nTemplates\n---------\n\nA *template* is a collection of *properties* that a record should have.\n*Templates* always apply to a given model, and then you can choose among the\ncurrent templates for the model you are using when you edit a record of that\nmodel.\n\nI.e., This addon includes a demo template called \"Smart partners\", that applies\nto the model ``res.partner``, so if you edit any partner, you can choose that\ntemplate and get its properties autofilled.\n\nProperties\n----------\n\nA *property* is the \"name\" of the field. *Templates* can have any amount of\n*properties*, and when you apply a *template* to a record, it automatically\ngets all of its *properties* filled, empty (unless they have a *Default\nvalue*), ready to assign *values*.\n\nYou can set a property to as *required* to force it have a value, although you\nshould keep in mind that for yes/no properties, this would mean that only *yes*\ncan be selected, and for numeric properties, zero would be forbidden.\n\nAlso you can set *Minimum* and *Maximum* limits for every *property*, but those\nlimits are only used when the data type is text (to constrain its length) or\nnumber. To skip this constraint, just set a maximum smaller than the minimum.\n\n*Properties* always belong to a template, and as such, to a model.\n\n*Properties* define the data type (text, number, yes/no...), and when the type\nis \"Selection\", then you can define what *options* are available.\n\nI.e., the \"Smart partners\" *template* has the following *properties*:\n\n- Name of his/her teacher\n- Amount of people that hates him/her for being so smart\n- Average note on all subjects\n- Does he/she believe he/she is the smartest person on earth?\n- What weaknesses does he/she have?\n\nWhen you set that template to any partner, you will then be able to fill these\n*properties* with *values*.\n\nCategories\n----------\n\n*Properties* can also belong to a *category*, which allows you to sort them in\na logical way, and makes further development easier.\n\nFor example, the ``website_sale_custom_info`` addon uses these to display a\ntechnical datasheet per product in your online shop, sorted and separated by\ncategory.\n\nYou are not required to give a *category* to every *property*.\n\nOptions\n-------\n\nWhen a *property*'s type is \"Selection\", then you define the *options*\navailable, so the *value* must be one of these *options*.\n\nI.e., the \"What weaknesses does he/she have?\" *property* has some options:\n\n- Loves junk food\n- Needs videogames\n- Huge glasses\n\nThe *value* will always be one of these.\n\nValue\n-----\n\nWhen you assign a *template* to a partner, and then you get the *properties* it\nshould have, you still have to set a *value* for each property.\n\n*Values* can be of different types (whole numbers, constrained selection,\nbooleans...), depending on how the *property* was defined. However, there is\nalways the ``value`` field, that is a text string, and converts automatically\nto/from the correct type.\n\nWhy would I need this?\n~~~~~~~~~~~~~~~~~~~~~~\n\nImagine you have some partners that are foreign, and that for those partners\nyou need some extra information that is not needed for others, and you do not\nwant to fill the partners model with a lot of fields that will be empty most of\nthe time.\n\nIn this case, you could define a *template* called \"Foreign partners\", which\nwill be applied to ``res.partner`` objects, and defines some *properties* that\nthese are expected to have.\n\nThen you could assign that *template* to a partner, and automatically you will\nget a subtable of all the properties it should have, with tools to fill their\n*values* correctly.\n\nDoes this work with any model?\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYes and no.\n\nYes, because this is a base module that provides the tools to make this work\nwith any model.\n\nNo, because, although the tools are provided, they are only applied to the\n``res.partner`` model. This is by design, because different models can have\ndifferent needs, and we don't want to depend on every possible model.\n\nSo, if you want to apply this to other models, you will have to develop a\nlittle additional addon that depends on this one. If you are a developer, refer\nto the *Development* section below.\n\n**Table of contents**\n\n.. contents::\n   :local:\n\nInstallation\n============\n\nThis module serves as a base for other modules that implement this behavior in\nconcrete models.\n\nThis module is a technical dependency and is to be installed in parallel to\nother modules.\n\nConfiguration\n=============\n\nTo enable the main *Custom Info* menu:\n\n#. Enable *Settings > General Settings > Manage custom information*.\n\nTo enable partner's custom info tab:\n\n#. Enable *Settings > General Settings > Edit custom information in partners*.\n\nUsage\n=====\n\nThis module defines *Custom Info Templates* that define what properties are\nexpected for a given record.\n\nTo define a template, you need to:\n\n* Go to *Custom Info > Templates*.\n* Create one.\n* Add some *Properties* to it.\n\nAll database records with that template enabled will automatically fill those\nproperties.\n\nTo manage the properties, you need to:\n\n* Go to *Custom Info > Properties*.\n\nTo manage the property categories, you need to:\n\n* Go to *Custom Info > Categories*.\n\nSome properties can have a number of options to choose, to manage them:\n\n* Go to *Custom Info > Options*.\n\nTo manage their values, you need to:\n\n* Go to *Custom Info > Values*.\n\nDevelopment\n===========\n\nTo create a module that supports custom information, just depend on this module\nand inherit from the ``custom.info`` model.\n\nSee an example in the ``product_custom_info`` addon.\n\nKnown issues / Roadmap\n======================\n\n* Custom properties cannot be shared among templates.\n* Required attributes are for now only set in the UI, not in the ORM itself.\n* Support recursive templates using options\n\n  .. figure:: https://raw.githubusercontent.com/base_custom_info/static/description/customizations-everywhere.jpg\n     :alt: Customizations Everywhere\n\n  If you assign an *additional template* to an option, and while using the owner\n  form you choose that option, you can then press *reload custom information\n  templates* to make the owner update itself to include all the properties in all\n  the involved templates. If you do not press the button, anyway the reloading\n  will be performed when saving the owner record.\n\n  .. figure:: https://raw.githubusercontent.com/base_custom_info/static/description/templateception.jpg\n     :alt: Templateception\n\n  I.e., if you select the option \"Needs videogames\" for the property \"What\n  weaknesses does he/she have?\" of a smart partner and press *reload custom\n  information templates*, you will get 2 new properties to fill: \"Favourite\n  videogames genre\" and \"Favourite videogame\".\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us to smash it by providing a detailed and welcomed\n`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_custom_info%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n~~~~~~~\n\n* Tecnativa\n\nContributors\n~~~~~~~~~~~~\n\n* `Tecnativa <https://www.tecnativa.com>`__:\n\n  * Rafael Blasco <rafael.blasco@tecnativa.com>\n  * Carlos Dauden <carlos.dauden@tecnativa.com>\n  * Sergio Teruel <sergio.teruel@tecnativa.com>\n  * Jairo Llopis <jairo.llopis@tecnativa.com>\n  * Pedro M. Baeza <pedro.baeza@tecnativa.com>\n  * Alexandre D\u00edaz <alexandre.diaz@tecnativa.com>\n* Creu Blanca:\n\n  * Enric Tobella <etobella@creublanca.es>\n* Solvos:\n\n  * David Alonso <david.alonso@solvos.es>\n* Ecosoft:\n\n  * Kitti U. <kittiu@ecosoft.co.th> (migration to v14)\n\nMaintainers\n~~~~~~~~~~~\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n   :alt: Odoo Community Association\n   :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\nThis module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/14.0/base_custom_info>`_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n\n\n",
    "bugtrack_url": null,
    "license": "LGPL-3",
    "summary": "Add custom field in models",
    "version": "14.0.1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/OCA/server-tools"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cab3ee34515e756699b5e0b21f77a61237bc72d19385c12488f5636e57e75359",
                "md5": "32d3eba17570bc68f5db4a08a15d1da3",
                "sha256": "ef77be1e8ed71b52266dcb9987233a4b53915a541f130541fcca7c0d3ca3b69e"
            },
            "downloads": -1,
            "filename": "odoo14_addon_base_custom_info-14.0.1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "32d3eba17570bc68f5db4a08a15d1da3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 399817,
            "upload_time": "2023-10-29T11:44:46",
            "upload_time_iso_8601": "2023-10-29T11:44:46.662169Z",
            "url": "https://files.pythonhosted.org/packages/ca/b3/ee34515e756699b5e0b21f77a61237bc72d19385c12488f5636e57e75359/odoo14_addon_base_custom_info-14.0.1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-29 11:44:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OCA",
    "github_project": "server-tools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "odoo14-addon-base-custom-info"
}
        
Elapsed time: 0.17058s