This commit is contained in:
2026-02-24 20:25:32 +01:00
parent 56f2c3a4a6
commit 20f2b87d99

View File

@@ -144,7 +144,7 @@ class Fee(ModelSQL,ModelView):
if self.auto_calculation:
return (qt * Decimal(unit.factor) / Decimal(self.unit.factor)).to_integral_value(rounding=ROUND_UP)
@fields.depends('mode','_parent_line.lots','_parent_sale_line.lots')
@fields.depends('price','mode','_parent_line.lots','_parent_sale_line.lots')
def on_change_with_unit(self, name=None):
if self.mode != 'ppack':
line = self.line
@@ -156,6 +156,12 @@ class Fee(ModelSQL,ModelView):
return line.lots[0].lot_unit_line
else:
return line.lots[1].lot_unit_line
if self.shipment_in:
Lot = Pool().get('lot.lot')
lots = Lot.search([('lot_shipment_in','=',self.shipment_in.id)])
logger.info("ON_CHANGE_WITH_UNIT:%s",lots)
if lots:
return lots[0].lot_unit_line
else:
return None