Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
5843 Widoki

I'll like to know if there's a way to trigger a method when the Save action_button is clicked?

I can't use it so that I overwrite the write method because that throws a RuntimeError: maximum recursion depth exceeded in cmp and it only triggers it when something is changed! 

I tried to do all that the method does with depends like it was suggested in my other post about the RuntimeError, but that doesn't work. Some record IDs are  object.model NewId! 

This method that I want to trigger is just to refresh the values from relation models that can't be accessed on edit because  object.model NewId.

I can trigger the method from a button from the view but that's not user friendly, because he has to do two clicks instead of one.

So is there a way to do this without changing any odoo core methods? If it is possible an example would be nice.  

Awatar
Odrzuć

I think you can do it with overriding the create or write method. Just update the question with the code you are working on

Autor

No I can't... https://www.odoo.com/forum/help-1/question/runtimeerror-maximum-recursion-depth-exceeded-in-cmp-problem-133054

The code is more than 1000 lines so I can't post it. It's like a excel table where you do calculations.

Powiązane posty Odpowiedzi Widoki Czynność
0
wrz 17
3938
2
lip 25
4523
2
gru 24
7691
2
lis 24
28443
2
maj 24
7422