Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I'm trying to create a workflow which transitions to the next step when answer_count > 5. Answers are in a separate model
answer_ids = fields.One2many(comodel_name="module.answer", string="Answer", inverse_name="question_id")
answer_count = fields.Integer(string="Answer Count", compute="_count_answers")
for rec in self:
rec.answer_count = len(self.answer_ids)
I have tried:
<record model="workflow.transition" id="answers_received">
<field name="act_from" ref="waiting"/>
<field name="act_to" ref="done"/>
<field name="condition">answer_count >= 5</field>
But it seems like it doesn't re-evaluate when a new answer is received.
What would be the right way to re-test the transition condition?
Does it require a trigger? If so, how would I re-install the triggers on every try that the condition is not met? The documentation says: triggers are not re-installed whenever the transition is re-tried.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 05/07/16 08:15|
|Seen: 1406 times|
|Last updated: 24/10/17 12:24|