← Back to team overview

openerp-community team mailing list archive

Update a field in model product.template when PO is confirmed

 


 Update a field in model product.template when PO is confirmed

Hello, I have Odoo 8 running over Win 7 x64.

I am developing a new module, I have created a class that inherit from product.template:

   from openerp import fields, models

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

        last_cost_price = fields.Float(digits=(8,2), string="Last cost
   price", readonly=True)

When the user confirms a PO, I want to read every line order and set the unit_price of this order_line in last_cost_price of the corresponding product.template.

Have I to override wkf_confirm_order() method of purchase_order class? In this case, how can I access to product.last_cost_price attribute to edit it?

Thanks!


Follow ups