stock_move.py 500 B

123456789101112131415
  1. # -*- encoding: utf-8 -*-
  2. # Copyright 2020 Akretion Renato Lima <renato.lima@akretion.com.br>
  3. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  4. from openerp import models, fields, api, _
  5. class StockMove(models.Model):
  6. _inherit = 'stock.move'
  7. def _prepare_procurement_values(self):
  8. values = super()._prepare_procurement_values()
  9. if self.sale_line_id and self.sale_line_id.bom_id:
  10. values['bom_id'] = self.sale_line_id.bom_id
  11. return values