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

I am used to inheriting views and adding columns or fields to them, but I can't do it in this view: I simply added a boolean field and inehrited the form view in stock.picking to add it, but I am always getting an error, can I get some help? This is the inheritting code:


ir.ui.view" id="update_qty_manual2_inherit">
stock.picking.inherit
stock.picking







Avatar
Discard
Best Answer

Hi,

Here as you need to add a new field to detailed operation tab, you have to inherit this tree view: stock.view_stock_move_line_detailed_operation_tree.

Inherit the above tree view and add your fields to this tree. Adding field to one2many is bit different compared to normal fields.

Sample Code is added in comment section:

Thanks

Avatar
Discard

<record id="view_stock_move_line_detailed_operation_tree_mrp" model="ir.ui.view">
<field name="name">stock.move.line.operations.tree.mrp</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="description_bom_line" optional="show" attrs="{'column_invisible': [('parent.has_kits', '=', False)]}"/>
</xpath>
</field>
</record>

Author

Thank you! It worked

Related Posts Replies Views Activity
2
Mar 15
8477
3
Mar 15
12200
2
Nov 24
262
1
Oct 24
327
4
Oct 24
321