main #7
@@ -100,7 +100,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
if lqt:
|
if lqt:
|
||||||
return lqt[0].id
|
return lqt[0].id
|
||||||
|
|
||||||
@fields.depends('auto_calculation','mode','_parent_line.unit','_parent_line.lots','_parent_sale_line.unit','_parent_sale_line.lots','_parent_shipment_in.id')
|
@fields.depends('unit','auto_calculation','mode','_parent_line.unit','_parent_line.lots','_parent_sale_line.unit','_parent_sale_line.lots','_parent_shipment_in.id')
|
||||||
def on_change_with_quantity(self, name=None):
|
def on_change_with_quantity(self, name=None):
|
||||||
qt = None
|
qt = None
|
||||||
line = self.line
|
line = self.line
|
||||||
@@ -108,7 +108,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
line = self.sale_line
|
line = self.sale_line
|
||||||
if line:
|
if line:
|
||||||
if line.lots:
|
if line.lots:
|
||||||
qt = sum([e.get_current_quantity_converted() for e in line.lots])
|
qt = sum([e.get_current_quantity() for e in line.lots])
|
||||||
if not qt:
|
if not qt:
|
||||||
LotQt = Pool().get('lot.qt')
|
LotQt = Pool().get('lot.qt')
|
||||||
lqts = LotQt.search(['lot_shipment_in','=',self.shipment_in.id])
|
lqts = LotQt.search(['lot_shipment_in','=',self.shipment_in.id])
|
||||||
@@ -119,7 +119,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
else:
|
else:
|
||||||
if self.auto_calculation:
|
if self.auto_calculation:
|
||||||
return Decimal(int(qt/Decimal(self.unit.factor)))
|
return Decimal(int(qt/Decimal(self.unit.factor)))
|
||||||
|
|
||||||
@fields.depends('mode','_parent_line.lots','_parent_sale_line.lots')
|
@fields.depends('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':
|
||||||
@@ -133,7 +133,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
else:
|
else:
|
||||||
return line.lots[1].lot_unit_line
|
return line.lots[1].lot_unit_line
|
||||||
else:
|
else:
|
||||||
return self.unit
|
return None
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user