This question has been flagged
3976 Views

Hi, I have changed the default Tree view when the user clicks the 'Add' button on a many2many field.

This is the code :

<record id="view_new_sale" model="ir.ui.view"> <field name="name">view.new.sale</field> <field name="model">product.details</field> <field name="arch" type="xml"> <form string="Product form view" version="7.0"> <field name="products" widget="many2many_list" context="{'tree_view_ref':'_new_tree.product_product_tree'}"> <tree string="Products" >="" <field="" name="qtty"/> <field name="name"/> <field name="type" invisible="1"/> <field name="variants" groups="product.group_product_variant"/> <field name="uom_id" string="Unit of Measure" groups="product.group_uom"/>--> <field name="qty_available"/> <field name="virtual_available"/> <field name="lst_price"/> <field name="price" invisible="not context.get('pricelist',False)"/> </tree> </form> </field> </record>

Well, "products" is my many2many field, and with context="{'tree_view_ref':'_new_tree.product_product_tree'}" I change the default view explained before.

And the code of '_new_tree.product_product_tree' is :

<record id="product_product_tree" model="ir.ui.view"> <field name="name">product.product.trees</field> <field name="model">product.product</field> <field name="arch" type="xml"> <tree string="Products" editable="bottom" >="" <field="" name="name"/> <field name="qtty"/> </tree> </field> </record>

Then the first view appears, and when I click 'Add' displays the second tree view, but I can not edit the field 'qtty' in the second view, when I try to do it, the system takes me back to the first view, but I need to edit it on the second "product_product_tree" view, it seems like editable="bottom" is not working on my second view.

Do you have any suggestions?

Thanks in advance!!

Avatar
Discard