Merge dev from main #1

Merged
admin merged 25 commits from main into dev 2026-01-05 13:03:46 +00:00
Showing only changes of commit e5056c6ea1 - Show all commits

View File

@@ -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: