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

<record id="view_shrinkage_record_line_tree" model="ir.ui.view">
<field name="name">shrinkage.record.line.tree</field>
<field name="model">shrinkage.record.line</field>
<field name="arch" type="xml">
<field name="shrinkage_record_line_ids"> 
<tree editable="bottom" string="Shrinkage Details">
<field name="product_name"/>
<field name="beg_qty_pcs"/>
<field name="beg_qty_kgs"/>
<field name="purchase_pcs"/>
<field name="purchase_kgs"/>
<field name="trunking_in_pcs"/>
<field name="trunking_in_kgs"/>
<field name="transfer_in_pcs"/>
<field name="transfer_in_kgs"/>
<field name="sales_pcs"/>
<field name="sales_kgs"/>
<field name="trunking_out_pcs"/>
<field name="trunking_out_kgs"/>
<field name="transfer_out_pcs"/>
<field name="transfer_out_kgs"/>
<field name="qty_on_hand_pcs"/>
<field name="qty_on_hand_kgs"/>
<field name="actual_pcs" attrs="{'invisible':[('vs_actual', '!=', False)]}"/>
<field name="actual_kgs" attrs="{'invisible':[('vs_actual', '!=', False)]}"/>
<field name="shr_inc_pcs"/>
<field name="shr_inc_kgs"/>
<field name="value"/>
</tree>
</field>
</field>
</record>


how can i insert this fields in a many2one? or one2many? field, the shrinkage_record_line_ids is the one2many from shrinkage.record model and I'm in the model shrinkage.record.line and it has shrinkage_record_id which is a many2one.


Do I used one2many or many2one?Thank in advance for the answers

Avatar
Discard
Best Answer

https://odoo-development.readthedocs.io/en/latest/dev/py/x2many.html

read the doc and do like this

field_ids = [(X,X,self.alarm_ids.ids)
Avatar
Discard
Related Posts Replies Views Activity
1
Mar 23
781
0
Dec 22
1505
0
Jun 21
1838
0
Jun 20
4178
0
Dec 18
93