manage attrs attribute, espesialy for readonly

This commit is contained in:
Pierre Verkest
2015-10-03 01:15:27 +02:00
parent 0c41e40ec5
commit 858d554cfc
3 changed files with 55 additions and 17 deletions

View File

@@ -22,19 +22,14 @@ Example
```
<field name="active"
widget="boolean_switch"
attrs="{'readonly': [('login', '=', 'admin')]}"
context="{'fake_parameter': 'foo'}"
options="{'quick_edit': True, 'extra': {'onText': 'Yes', 'offText': 'No' }}"/>
```
.. note::
``context`` is sent to the ``write`` method of the field model in case of
special needs with the quick edition.
Options
-------
quick_edit
~~~~~~~~~~
@@ -60,7 +55,7 @@ extra
* **wrapperClass**: Container element class(es) - default: `"wrapper"`,
..warning::
.. warning::
Those parameters are overwritten by this module or highly discouraged:
@@ -71,6 +66,17 @@ extra
* **onInit**: Callback function to execute on initialization - default: `function() {}`,
* **onSwitchChange**: Callback function to execute on switch state change - default: `function() {}`
attrs
-----
This attribute is supported as expected!
context
-------
``context`` is sent to the ``write`` method of the field model in case of
special needs with the quick edition.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot