[ADD] web_widget_dropdown_dynamic

[UPD] Update web_widget_dropdown_dynamic.pot

[UPD] Update web_widget_dropdown_dynamic_example.pot

[UPD] README.rst

[ADD] icon.png

[UPD] README.rst
This commit is contained in:
Alexey Pelykh
2019-09-11 14:04:03 +02:00
committed by Thanakrit Pintana
parent 222bec5c5d
commit 5f03f1b541
14 changed files with 1040 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
.. code-block:: python
@api.model
def method_name(self):
values = [
('value_a', 'Title A'),
]
if self.env.context.get('depending_on') == True:
values += [
('value_b', 'Title B'),
]
return values
.. code-block:: xml
<field
name="other_field"
/>
<field
name="char_field"
widget="dynamic_dropdown"
values="method_name"
context="{'depending_on': other_field}"
/>