Closed sehngya closed 5 years ago
Hi @sehngya. According to the trace I suppose the call_task
method misses the second argument method
.
Did you already checked the "celery_example" module, with some call_task
calls implemented?
Check over here: https://github.com/novacode-nl/odoo-celery/blob/12.0/celery_example/models/celery_example.py
I hope you'll get it, otherwise let me know.
Cheers, Bob
I'm sorry,I checked the "celery_example" module,I set argument method
and it's doesn't work
@api.multi def action_queue_example_line(self): try: self.env["celery.task"].call_task("celery.example", "queue_example_line", example_id=self.id) except Exception as e: _logger.error(e)
Did you setup a running Celery server/worker? You completed all steps in the documentation?
Yes, I just solved the problem.In method call_task ,if I set bind=False,The problem arises. I alter bind=True,the problem been gone and i don't know why
Please could you send or show me the piece of code/call?
@bobslee Thank you very much. I will try to find out the reason
@bobslee Yes,of course.
@sehngya There's a reason the Celery Task (dispatcher function) is a bounded task. It's especially needed for retries in this module. More info about bound tasks: http://docs.celeryproject.org/en/latest/userguide/tasks.html#bound-tasks
@bobslee Thank you for your help.
Hi ,Bob! I've got a problem and as I don't know what to do I thought I'd write to you and ask for your advice. When i calling tasks(i only set celery broker to redis ),the following error occurs Traceback (most recent call last): File "d:\anaconda3\envs\odoo3.5\lib\site-packages\celery\app\trace.py", line 382, in trace_task R = retval = fun(*args, *kwargs) File "d:\anaconda3\envs\odoo3.5\lib\site-packages\celery\app\trace.py", line 641, in __protected_call__ return self.run(args, **kwargs) TypeError: call_task() missing 1 required positional argument: 'method'