It was said that in OpenERP the functions
def create(self, cr, user, vals, context=None)
def update(self, cr, user, vals, context=None)
exist within the orm.Model that are called if you save a new record or if you update one. I need to inherit those functions to prevent ERP from saving or updating any records if certain typed-in data have the wrong format. I found the create function and was able to inherit and my implementation for this what I wanted works fine with that. However, I wasn't able to find the function that is called when I want to update a record. It is definitely not "update" I'm using OpenERP 7. What function is called for updating a record? Please can anybody help
I tested overwriting the "write function", but it doesn't seem to use this function. Even if I try using a variable that obviously doesn't exist, there is no error. Only if I delete the write function from the orm Model it uses this function.
What do I do wrong? It works fine with the inherited "create" function. how can I force the system to use the new write function?
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
|Asked: 2/18/16, 4:42 AM|
|Seen: 725 times|
|Last updated: 2/18/16, 9:39 AM|