diff --git a/modules/purchase_trade/lot.py b/modules/purchase_trade/lot.py index f135c88..3d5a2c1 100755 --- a/modules/purchase_trade/lot.py +++ b/modules/purchase_trade/lot.py @@ -1168,6 +1168,7 @@ class LotQt( @classmethod def validate(cls, lotqts): super(LotQt, cls).validate(lotqts) + Date = Pool().get('ir.date') #Update Move for lqt in lotqts: cls.updateMove(lqt.lot_move) @@ -1177,15 +1178,15 @@ class LotQt( if lqt.lot_p and lqt.lot_quantity > 0: pl = lqt.lot_p.line logger.info("VALIDATE_LQT_PL:%s",pl) - Pnl = Pool().get('valuation.valuation') - pnl = Pnl.search([('line','=',pl.id)]) - if pnl: - Pnl.delete(pnl) - pnl_lines = [] - pnl_lines.extend(pl.get_pnl_fee_lines()) - pnl_lines.extend(pl.get_pnl_price_lines()) - pnl_lines.extend(pl.get_pnl_der_lines()) - Pnl.save(pnl_lines) + # Pnl = Pool().get('valuation.valuation') + # pnl = Pnl.search([('line','=',pl.id),('date','=',Date.today())]) + # if pnl: + # Pnl.delete(pnl) + # pnl_lines = [] + # pnl_lines.extend(pl.get_pnl_fee_lines()) + # pnl_lines.extend(pl.get_pnl_price_lines()) + # pnl_lines.extend(pl.get_pnl_der_lines()) + # Pnl.save(pnl_lines) #Open position update if pl.quantity_theorical: