13.03.26
This commit is contained in:
@@ -66,12 +66,13 @@ class Fee(ModelSQL,ModelView):
|
||||
quantity = fields.Numeric("Qt",digits='unit',states={'readonly': (Eval('mode') != 'ppack') | Bool(Eval('auto_calculation'))})
|
||||
unit = fields.Many2One('product.uom',"Unit",domain=[
|
||||
If(Eval('mode') == 'ppack',
|
||||
('category', '=', 8),
|
||||
('category', '=', Eval('packing_category')),
|
||||
()),
|
||||
],
|
||||
states={
|
||||
'readonly': Eval('mode') != 'ppack',
|
||||
'readonly': (Eval('mode') != 'ppack' | Eval('mode') != 'perqt'),
|
||||
})
|
||||
packing_category = fields.Function(fields.Integer("Packing Category"),'get_packing_category')
|
||||
inherit_shipment = fields.Boolean("Inh Sh",states={
|
||||
'invisible': (Eval('shipment_in')),
|
||||
})
|
||||
@@ -109,6 +110,12 @@ class Fee(ModelSQL,ModelView):
|
||||
if lqt:
|
||||
return lqt[0].id
|
||||
|
||||
def get_packing_category(self, name):
|
||||
UnitCategory = Pool().get('product.uom.category')
|
||||
packing = UnitCategory.search(['name','=','Packing'])
|
||||
if packing:
|
||||
return packing[0].id
|
||||
|
||||
@fields.depends('line','sale_line','shipment_in','lots','price','unit','auto_calculation','mode','_parent_line.unit','_parent_line.lots','_parent_sale_line.unit','_parent_sale_line.lots')
|
||||
def on_change_with_quantity(self, name=None):
|
||||
qt = None
|
||||
|
||||
Reference in New Issue
Block a user