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!

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : openerp-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

Reply via email to