main #7

Merged
admin merged 620 commits from main into dev 2026-03-29 13:03:25 +00:00
2 changed files with 11 additions and 5 deletions
Showing only changes of commit db207f4995 - Show all commits

View File

@@ -270,7 +270,7 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
else:
sale = Sale()
sale_line = SaleLine()
sale.party = Party.getPartyByName(customer)
sale.party = Party.getPartyByName(customer,'CLIENT')
logger.info("SALE_PARTY:%s",sale.party)
sale.reference = reference
sale.company = 6

View File

@@ -1,12 +1,9 @@
from trytond.model import ModelSQL, ModelView, fields
from trytond.pool import PoolMeta
from trytond.pool import PoolMeta, Pool
from trytond.exceptions import UserError
from trytond.modules.purchase_trade.purchase import (TRIGGERS)
from trytond.transaction import Transaction
__all__ = ['Party']
__metaclass__ = PoolMeta
class PartyExecution(ModelSQL,ModelView):
"Party Execution"
__name__ = 'party.execution'
@@ -34,5 +31,14 @@ class Party(metaclass=PoolMeta):
p = cls()
p.name = party
cls.save([p])
if category:
Category = Pool().get('party.category')
cat = Category.search(['name','=',category])
if cat:
PartyCategory = Pool().get('party.party-party.category')
pc = PartyCategory()
pc.party = p.id
pc.category = cat[0].id
PartyCategory.save([pc])
return p