24.02.26
This commit is contained in:
@@ -144,7 +144,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
if self.auto_calculation:
|
if self.auto_calculation:
|
||||||
return (qt * Decimal(unit.factor) / Decimal(self.unit.factor)).to_integral_value(rounding=ROUND_UP)
|
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):
|
def on_change_with_unit(self, name=None):
|
||||||
if self.mode != 'ppack':
|
if self.mode != 'ppack':
|
||||||
line = self.line
|
line = self.line
|
||||||
@@ -156,6 +156,12 @@ class Fee(ModelSQL,ModelView):
|
|||||||
return line.lots[0].lot_unit_line
|
return line.lots[0].lot_unit_line
|
||||||
else:
|
else:
|
||||||
return line.lots[1].lot_unit_line
|
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:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user