factory_ref_stock.py 372 B

1234567891011121314
  1. from openerp import models, fields, api
  2. class factory_ref_stock(models.Model):
  3. _inherit = 'stock.move'
  4. _name = 'stock.move'
  5. @api.one
  6. @api.depends('product_id')
  7. def get_factory_ref(self):
  8. self.factory_ref = self.product_id.factory_reference
  9. factory_ref = fields.Char(string="Factory Reference", compute="get_factory_ref")