26.01.26
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user