Community mailing list archives

community@mail.odoo.com

Re: Dynamic O2M Tree View based on value of another field

by
nikesh
- 07/14/2016 00:33:36
Hello,

It is possible by adding condition for "invisible" attribute in each field in xml as:

<field name="sel_field" />
<field name="on2m_field">
     <tree>
              <field name="field_a" />
              <field name="field_b" attrs="{'invisible': [(parent.sel_field,'in',['view1','view2'])]}" />
              <field name="field_c" attrs="{'invisible': [(parent.sel_field,'in',['view1'])]}" />
              <field name="field_d" attrs="{'invisible': [(parent.sel_field,'in',['view2'])]}" />
              <field name="field_e" attrs="{'invisible': [(parent.sel_field,'in',['view3'])]}" />
              <field name="field_f" attrs="{'invisible': [(parent.sel_field,'in',['view3'])]}" />
     </tree>
</field>

Hope this will work .

Thanks & Regards

On Thu, Jul 14, 2016 at 6:36 AM, vak0160 <vak0160.work@gmail.com> wrote:

Hello Carlos,

I don't want to filter the result, but I want to set the visibility of field/column of a O2M field dynamically based on a selection field.

On 07/13/2016 09:46 PM, Carlos Rodríguez wrote:
Hello,

Isn't this covered with the search?, you can filter the value of the selection field, and the results in the tree view will match it.

Regards,

2016-07-12 23:47 GMT-05:00 vak0160 <vak0160.work@gmail.com>:

Hello Community,

I have a O2M field and a selection field. Can I set the visible fields for O2M field’s Tree based on the selection field?

For example:

  • Selection field = view1
field a field b field c
a b c
  • Selection field = view2
field a field b field d
a b d
  • Selection field = view3
field a field e field f
a e f
-- 
Regards,
Andre

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


-- 
Regards,
Andre

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe