Files
web/web_widget_dropdown_dynamic/readme/USAGE.rst
Alexey Pelykh 5f03f1b541 [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
2021-11-30 16:11:40 +07:00

25 lines
510 B
ReStructuredText

.. 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}"
/>