[imp] nfu_sale_order_batch_packaging: remove product recreation and duplicated code

This commit is contained in:
Niels Göttsch 2025-03-18 20:31:46 +01:00 committed by Niels Göttsch
parent 74b1fdbe6e
commit 8c2e112f70
3 changed files with 8 additions and 3 deletions

View file

@ -32,7 +32,6 @@ class SaleOrderBatchProduct(models.Model):
readonly=False, readonly=False,
precompute=True, precompute=True,
domain="[('sales', '=', True), ('product_id','=',product_id)]", domain="[('sales', '=', True), ('product_id','=',product_id)]",
check_company=True,
) )
product_packaging_qty = fields.Float(compute="_compute_product_packaging_qty") product_packaging_qty = fields.Float(compute="_compute_product_packaging_qty")

View file

@ -23,8 +23,13 @@
</group> </group>
<notebook> <notebook>
<page string="Sale Order Lines" name="order_line"> <page string="Sale Order Lines" name="order_line">
<field name="sale_order_line_ids" widget="section_and_note_one2many"> <field
name="sale_order_line_ids"
widget="section_and_note_one2many"
attrs="{'readonly': [('state', 'in', ('closed'))]}"
>
<tree editable="bottom" create="0"> <tree editable="bottom" create="0">
<field name="company_id" invisible="1"/>
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="order_id"/> <field name="order_id"/>
<field name="order_partner_id"/> <field name="order_partner_id"/>

View file

@ -122,11 +122,12 @@
widget="section_and_note_one2many" widget="section_and_note_one2many"
attrs="{'readonly': [('state', 'in', ('closed'))]}" attrs="{'readonly': [('state', 'in', ('closed'))]}"
> >
<tree editable="bottom"> <tree create="0" editable="bottom">
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="order_id"/> <field name="order_id"/>
<field name="order_partner_id"/> <field name="order_partner_id"/>
<field name="product_template_id" optional="hide"/> <field name="product_template_id" optional="hide"/>
<field name="product_id" optional="hide"/>
<field name="name"/> <field name="name"/>
<field name="product_uom_qty"/> <field name="product_uom_qty"/>
<field name="company_id" invisible="1"/> <field name="company_id" invisible="1"/>