How to get the value from another field when press the button save

Multi tool use
Multi tool use


How to get the value from another field when press the button save



product.py


from openerp import fields, models, api


class product(models.Model):
_inherit = 'product.template'

product_tmpl_id = fields.Many2one('product.template', string='Product')
list_price = fields.Float(string="Prix de vente", store=True, related='product_tmpl_id.seller_ids.price')





Did you override create method?
– WaKo
Jul 2 at 11:48



create





No i didn't override create methode
– Dhouha
Jul 2 at 15:28





When you press save button for the first time it calls the create method otherwize it calls the write method, so you can override one method or both to get your value from where you want after calling super.
– WaKo
Jul 3 at 8:18


save


create


write


super





Thank you very much
– Dhouha
Jul 3 at 10:05









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

3Ma5RTn1Q3sIUAwHTJ6aIF7Q7,fC4ijSph3 ioMfSIwTgU4ekU,U
dJJzU,nLo0Q0V4y06B5LpSds,coYYE3fy keAClrqZ8fka sZ451spT,Ccbgj,oIVPf

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications