Merge dev from main #1
@@ -1168,6 +1168,7 @@ class LotQt(
|
|||||||
@classmethod
|
@classmethod
|
||||||
def validate(cls, lotqts):
|
def validate(cls, lotqts):
|
||||||
super(LotQt, cls).validate(lotqts)
|
super(LotQt, cls).validate(lotqts)
|
||||||
|
Date = Pool().get('ir.date')
|
||||||
#Update Move
|
#Update Move
|
||||||
for lqt in lotqts:
|
for lqt in lotqts:
|
||||||
cls.updateMove(lqt.lot_move)
|
cls.updateMove(lqt.lot_move)
|
||||||
@@ -1177,15 +1178,15 @@ class LotQt(
|
|||||||
if lqt.lot_p and lqt.lot_quantity > 0:
|
if lqt.lot_p and lqt.lot_quantity > 0:
|
||||||
pl = lqt.lot_p.line
|
pl = lqt.lot_p.line
|
||||||
logger.info("VALIDATE_LQT_PL:%s",pl)
|
logger.info("VALIDATE_LQT_PL:%s",pl)
|
||||||
Pnl = Pool().get('valuation.valuation')
|
# Pnl = Pool().get('valuation.valuation')
|
||||||
pnl = Pnl.search([('line','=',pl.id)])
|
# pnl = Pnl.search([('line','=',pl.id),('date','=',Date.today())])
|
||||||
if pnl:
|
# if pnl:
|
||||||
Pnl.delete(pnl)
|
# Pnl.delete(pnl)
|
||||||
pnl_lines = []
|
# pnl_lines = []
|
||||||
pnl_lines.extend(pl.get_pnl_fee_lines())
|
# pnl_lines.extend(pl.get_pnl_fee_lines())
|
||||||
pnl_lines.extend(pl.get_pnl_price_lines())
|
# pnl_lines.extend(pl.get_pnl_price_lines())
|
||||||
pnl_lines.extend(pl.get_pnl_der_lines())
|
# pnl_lines.extend(pl.get_pnl_der_lines())
|
||||||
Pnl.save(pnl_lines)
|
# Pnl.save(pnl_lines)
|
||||||
|
|
||||||
#Open position update
|
#Open position update
|
||||||
if pl.quantity_theorical:
|
if pl.quantity_theorical:
|
||||||
|
|||||||
Reference in New Issue
Block a user