Skip to Content
Menu
This question has been flagged
1 Reply
1401 Views

Hello There!

At line 391 of basic_view.js the web client saves this property which is later used for rendering widgets. 

The way the logic is written, odoo only stores one fieldsInfo['myfield'] per field "name", so the widget that are used to render the fields below, will use always dynamic_attr="bird", because the first "dynamic_attr" gets overwritten by the last one in the arch.

<field name="myfield" dynamic_attr="butterfly" attrs="{'invisible': [('my','=','domain')]"/>
<field name="myfield" dynamic_attr="bird" attrs="{'invisible': [('my','!=','domain')]"/>

The desired outcome here I guess it would be to ignore the field that won't be rendered. How can we achieve this?

Thanks.


Avatar
Discard
Best Answer

You can create new related field which target to your original field.

something like:
myfield = fields.Char()
new_myfield = fields.Char(related='myfield')

When you define both fields in view, they are not override with each other.

Avatar
Discard
Related Posts Replies Views Activity
1
Dec 24
110
2
Nov 24
82
1
Oct 24
254
0
Sep 24
210
2
Sep 24
645