main #7

Merged
admin merged 620 commits from main into dev 2026-03-29 13:03:25 +00:00
2 changed files with 20 additions and 21 deletions
Showing only changes of commit 498da9a728 - Show all commits

View File

@@ -151,26 +151,26 @@ 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('price','mode','_parent_line.lots','_parent_sale_line.lots','shipment_in') # @fields.depends('price','mode','_parent_line.lots','_parent_sale_line.lots','shipment_in')
def on_change_with_unit(self, name=None): # def on_change_with_unit(self, name=None):
if self.mode != 'ppack' and self.mode != 'perqt': # if self.mode != 'ppack' and self.mode != 'perqt':
line = self.line # line = self.line
if not line: # if not line:
line = self.sale_line # line = self.sale_line
if line: # if line:
if line.lots: # if line.lots:
if len(line.lots) == 1: # if len(line.lots) == 1:
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: # if self.shipment_in:
Lot = Pool().get('lot.lot') # Lot = Pool().get('lot.lot')
lots = Lot.search([('lot_shipment_in','=',self.shipment_in.id)]) # lots = Lot.search([('lot_shipment_in','=',self.shipment_in.id)])
logger.info("ON_CHANGE_WITH_UNIT:%s",lots) # logger.info("ON_CHANGE_WITH_UNIT:%s",lots)
if lots: # if lots:
return lots[0].lot_unit_line # return lots[0].lot_unit_line
else: # else:
return self.unit # return self.unit
def get_lots(self, name): def get_lots(self, name):
logger.info("GET_LOTS_LINE:%s",self.line) logger.info("GET_LOTS_LINE:%s",self.line)

View File

@@ -7,7 +7,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="supplier"/> <field name="supplier"/>
<field name="mode"/> <field name="mode"/>
<field name="unit"/> <field name="unit"/>
<field name="packing_category"/>
<field name="auto_calculation" width="60"/> <field name="auto_calculation" width="60"/>
<field name="price"/> <field name="price"/>
<field name="currency"/> <field name="currency"/>