mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[ADD] web_widget_many2one_simple
This commit is contained in:
committed by
OCA-git-bot
parent
64f34f7c73
commit
575daf2e68
17
web_widget_many2one_simple/readme/CONFIGURE.rst
Normal file
17
web_widget_many2one_simple/readme/CONFIGURE.rst
Normal 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
|
||||
3
web_widget_many2one_simple/readme/CONTRIBUTORS.rst
Normal file
3
web_widget_many2one_simple/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
* `Tecnativa <https://www.tecnativa.com>`_:
|
||||
|
||||
* Alexandre D. Díaz
|
||||
6
web_widget_many2one_simple/readme/DESCRIPTION.rst
Normal file
6
web_widget_many2one_simple/readme/DESCRIPTION.rst
Normal 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
|
||||
11
web_widget_many2one_simple/readme/USAGE.rst
Normal file
11
web_widget_many2one_simple/readme/USAGE.rst
Normal 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="{"search": { "field": "name", "oper": "ilike" }}"/
|
||||
|
||||
** Only allows search by id's that starts with '1' ...
|
||||
Reference in New Issue
Block a user