10.03.26
This commit is contained in:
@@ -102,14 +102,14 @@ class Fee(ModelSQL,ModelView):
|
|||||||
Date = Pool().get('ir.date')
|
Date = Pool().get('ir.date')
|
||||||
return Date.today()
|
return Date.today()
|
||||||
|
|
||||||
# @classmethod
|
@classmethod
|
||||||
# def default_qt_state(cls):
|
def default_qt_state(cls):
|
||||||
# LotQtType = Pool().get('lot.qt.type')
|
LotQtType = Pool().get('lot.qt.type')
|
||||||
# lqt = LotQtType.search([('name','=','BL')])
|
lqt = LotQtType.search([('name','=','BL')])
|
||||||
# if lqt:
|
if lqt:
|
||||||
# return lqt[0].id
|
return lqt[0].id
|
||||||
|
|
||||||
@fields.depends('price','unit','auto_calculation','mode','_parent_line.unit','_parent_line.lots','_parent_sale_line.unit','_parent_sale_line.lots','_parent_shipment_in.id')
|
@fields.depends('price','unit','auto_calculation','mode','_parent_line.unit','_parent_line.lots','_parent_sale_line.unit','_parent_sale_line.lots','_parent_shipment_in')
|
||||||
def on_change_with_quantity(self, name=None):
|
def on_change_with_quantity(self, name=None):
|
||||||
qt = None
|
qt = None
|
||||||
unit = None
|
unit = None
|
||||||
@@ -122,7 +122,6 @@ class Fee(ModelSQL,ModelView):
|
|||||||
qt = sum([e.get_current_quantity() for e in line.lots])
|
qt = sum([e.get_current_quantity() for e in line.lots])
|
||||||
unit = line.lots[0].lot_unit_line
|
unit = line.lots[0].lot_unit_line
|
||||||
logger.info("ON_CHANGE_WITH_QT0:%s",qt)
|
logger.info("ON_CHANGE_WITH_QT0:%s",qt)
|
||||||
logger.info("ON_CHANGE_WITH_SHIPMENT_IN:%s",self.shipment_in)
|
|
||||||
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)])
|
||||||
@@ -133,6 +132,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
if not qt:
|
if not qt:
|
||||||
logger.info("ON_CHANGE_WITH_QT1:%s",qt)
|
logger.info("ON_CHANGE_WITH_QT1:%s",qt)
|
||||||
LotQt = Pool().get('lot.qt')
|
LotQt = Pool().get('lot.qt')
|
||||||
|
if self.shipment_in:
|
||||||
lqts = LotQt.search(['lot_shipment_in','=',self.shipment_in.id])
|
lqts = LotQt.search(['lot_shipment_in','=',self.shipment_in.id])
|
||||||
if lqts:
|
if lqts:
|
||||||
qt = Decimal(lqts[0].lot_quantity)
|
qt = Decimal(lqts[0].lot_quantity)
|
||||||
|
|||||||
Reference in New Issue
Block a user