mrp_production.py 902 B

123456789101112131415161718192021
  1. # -*- encoding: utf-8 -*-
  2. from openerp import models, api, fields
  3. class MrpProduction(models.Model):
  4. _inherit = 'mrp.production'
  5. sale_id = fields.Many2one(
  6. comodel_name='sale.order', string='Sale order',
  7. readonly=True, store=True,
  8. related='move_prod_id.procurement_id.sale_line_id.order_id')
  9. sale_line_id = fields.Many2one(
  10. comodel_name='sale.order.line', string='Sale Line',
  11. related='move_prod_id.procurement_id.sale_line_id')
  12. mrp_machine_id = fields.Many2one(related='sale_line_id.mrp_machine_id',
  13. string='Maquina', store=True)
  14. partner_id = fields.Many2one(related='sale_id.partner_id',
  15. string='Customer', store=True)
  16. date_order = fields.Datetime(related='sale_id.date_order',
  17. string='Fecha del Pedido', store=True)
  18. product_name=fields.Text(String='Descripción', related='sale_line_id.name', store=True)