Odoo Help

Welcome!

This community 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.

0

Show Modal on Stage Change of Project

By
Christoph
on 7/10/15, 9:41 AM 530 views

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:

  1. I created a new function with @api.onchange('stage') for model ticket.issue. But this function was never called (I added a test print).

  2. 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?

0

Anil R. Kesariya

--Anil R. Kesariya--
4321
| 6 5 8
Gandhinagar, India
--Anil R. Kesariya--
ERP Consultant

Key Skill
-
Technical & Functional Expert
Anil R. Kesariya
On 7/10/15, 1:27 PM

Hi Christoph,

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.


@api.multi 
def write(self, vals):
#your custom code
result = super(class_name, self).write()
#your custom code
return result

Hope this will help.

Regards,

Anil


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/10/15, 9:41 AM
Seen: 530 times
Last updated: 7/10/15, 1:27 PM