Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4830 Zobrazení

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?

Avatar
Zrušit
Nejlepší odpověď

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


Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
bře 23
2559
0
bře 15
3100
2
čvc 24
7864
3
čvc 25
1108
0
led 25
1102