Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
6369 Visualizzazioni

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.  

Avatar
Abbandona

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

Autore

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.

Post correlati Risposte Visualizzazioni Attività
0
set 17
4335
2
lug 25
5600
2
ott 25
8359
2
nov 24
29197
2
mag 24
8041