Skip to Content
Menu
This question has been flagged
4862 Views

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
Discard

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

Author

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.

Related Posts Replies Views Activity
0
Sep 17
3185
2
Nov 24
25081
2
May 24
5514
3
Mar 24
4963
0
Mar 24
262