[ADD] web_widget_many2one_simple

This commit is contained in:
Alexandre D. Díaz
2020-12-28 19:28:28 +01:00
committed by OCA-git-bot
parent 64f34f7c73
commit 575daf2e68
13 changed files with 1067 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
Attributes:
~~~~~~~~~~~
* regex [String]: Defines the regex to test the search criteria
* can_create [Boolean]: Allow create new records
* can_write [Boolean]: Allow edit the linked record
Options:
~~~~~~~~
* search [Dictionary]
* field: The field to use in the search process [Default is 'id']
* oper: The operator (like, ilike, etc...) [Default is '=']
* no_create: Invalidates the 'can_create' flag
* no_write: Invalidates the 'can_write' flag
* no_open: Disables open the linked record

View File

@@ -0,0 +1,3 @@
* `Tecnativa <https://www.tecnativa.com>`_:
* Alexandre D. Díaz

View File

@@ -0,0 +1,6 @@
This module adds a new widget to many2one fields that allows to link records
without any extra features (no autocomplete and no partial search).
* Preview
.. image:: ../static/img/preview.gif

View File

@@ -0,0 +1,11 @@
You need to declare the usage of the new widget as follows:
``<field name="xxx" widget="many2one_simple" options="...">``
Example:
~~~~~~~~
.. code:: xml
<field name="partner_id" widget="many2one_simple" regex="^1\d*" options="{&quot;search&quot;: { &quot;field&quot;: &quot;name&quot;, &quot;oper&quot;: &quot;ilike&quot; }}"/
** Only allows search by id's that starts with '1' ...