main #7

Merged
admin merged 620 commits from main into dev 2026-03-29 13:03:25 +00:00
Showing only changes of commit 408c5d82e4 - Show all commits

View File

@@ -261,7 +261,7 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
logger.info("DECLARATION_KEY:%s",dec_key)
declaration = SaleLine.search(['note','=',dec_key])
if declaration:
with Transaction().new_transaction() as trans1:
continue
sale_line = declaration[0]
logger.info("WITH_DEC:%s",sale_line)
vlot = sale_line.lots[0]
@@ -269,12 +269,9 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
if lqt and lqt[0].lot_p:
logger.info("VLOT_P:%s",lqt[0].lot_p)
lqt[0].lot_p.updateVirtualPart(round(lot_net_weight,2),sh[0],lqt[0].lot_s)
trans1.commit()
else:
sale = Sale()
sale_line = SaleLine()
with Transaction().new_transaction() as trans1:
sale.party = Party.getPartyByName(customer,'CLIENT')
logger.info("SALE_PARTY:%s",sale.party)
sale.reference = reference
@@ -306,9 +303,7 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
sale_line.created_by_code = False
sale_line.note = dec_key
SaleLine.save([sale_line])
trans1.commit()
with Transaction().new_transaction() as trans2:
ContractStart = Pool().get('contracts.start')
ContractDetail = Pool().get('contract.detail')
ct = ContractStart()
@@ -342,7 +337,6 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
type_=ct.type,
ct=ct,
)
trans2.commit()
#Lots creation
# vlot = sale_line.lots[0]