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.
We use the module "project" and "project_issue" of odoo. here we created a project with different stages. So the issues in this project can be moved in any stage. To indicate if an issue is done and for later usage we modified the stage configuration (added a field to indicate if this stage is for the "done tickets"). Later we want to run actions if one ticket is moved to this stage.
To avoid unintended changings of the stage changes of a ticket we want to show a model if the ticket is moved to the "done stage". This modal should ask if the user wants to change this ticket to this stage. I tried a bit but found no working solutions for this.
I tried these possible solutions:
I created a new function with @api.onchange('stage') for model ticket.issue. But this function was never called (I added a test print).
Another possible solution are the workflows. I created a new workflow for the project.issue model and created an action. Also this action wasn't called. But maybe I did something wrong because I never worked with workflows in odoo.
Do you have any suggestions or ideas how to solve this issue?
Try with write() method.
When the state being changed the write method is called in back end.
Here is the sample of write method if you are using api coding standard.
def write(self, vals):
#your custom code
result = super(class_name, self).write()
#your custom code
Hope this will help.
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: 7/10/15, 9:41 AM|
|Seen: 1140 times|
|Last updated: 7/10/15, 1:27 PM|