跳至內容
選單
此問題已被標幟
1 回覆
5838 瀏覽次數

I want change the company name field back to a default value if the user press my added button in edit mode of the form.

Changes should only writen to database if the orginal save button on the form pressed.

If i change the value via self.name = "default"  there is no update in the browser.

I dont't want use self.write.

Thanks

 

頭像
捨棄
最佳答案

What Odoo version are you using? That would make a difference in the code used.

However, I think your best bet is to look at on_change methods and how they work. I don't know if a button is going to help you out here. Especially since that usually checks for a write method for its changes and you have already mentioned you do not want to use that method.

頭像
捨棄
作者

Thanks, but the syntax of the return value for on_change methods like don't work in openerp 7 for buttons, as temporary solution i used a boolean field instead of a button