from celery import Celery
from celery_tryton import TrytonTask
from trytond.transaction import Transaction
celery = Celery('tryton')
celery.conf.TRYTON_DATABASE = 'tryton'
@celery.task(base=TrytonTask)
def create_ticket(client, contract, ticket_factory):
ticket_create_rs = client.ticket_create(
ticket=ticket_factory.build(),
article=ticket_factory.build_article(),
dynamic_fields=ticket_factory.build_dynamic_fields())
if ticket_create_rs:
econtract._save_ticket_number_ticket_id(ticket_create_rs)
Traceback (most recent call last):
File "/opt/eticom/trytond/trytond/protocols/dispatcher.py", line 162, in dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/opt/eticom/trytond/trytond/model/modelview.py", line 617, in wrapper
return func(cls, *args, **kwargs)
File "/opt/eticom/trytond/trytond/model/workflow.py", line 33, in wrapper
result = func(cls, filtered, *args, **kwargs)
File "/opt/eticom/trytond/trytond/modules/eticom/eticom_contract.py", line 616, in done
econtract.create_otrs_process_ticket()
File "/opt/eticom/trytond/trytond/modules/eticom/eticom_contract.py", line 739, in create_otrs_process_ticket
ticket_factory=ticket_factory)
File "/home/tryton/.virtualenvs/tryton/local/lib/python2.7/site-packages/celery/local.py", line 191, in __call__
return self._get_current_object()(*a, **kw)
File "/home/tryton/.virtualenvs/tryton/local/lib/python2.7/site-packages/celery_tryton.py", line 71, in __call__
with Transaction().start(database, 0):
File "/opt/eticom/trytond/trytond/transaction.py", line 76, in start
assert self.user is None
AssertionError