[MIG] Migrated the module mrp_bom_location to v13.

This commit is contained in:
sudhir-erpharbor
2019-10-11 16:57:21 +05:30
committed by Don Kendall
parent 679bed1daa
commit d6a2ca6b20
7 changed files with 37 additions and 42 deletions

View File

@@ -7,22 +7,15 @@ from odoo import api, fields, models
class MrpBom(models.Model):
_inherit = "mrp.bom"
location_id = fields.Many2one(
string='Location',
comodel_name='stock.location',
)
location_id = fields.Many2one(string="Location", comodel_name="stock.location")
@api.onchange('picking_type_id')
@api.onchange("picking_type_id")
def _onchange_picking_type_id(self):
if (self.picking_type_id and
self.picking_type_id.default_location_src_id):
if self.picking_type_id and self.picking_type_id.default_location_src_id:
self.location_id = self.picking_type_id.default_location_src_id
class MrpBomLine(models.Model):
_inherit = "mrp.bom.line"
location_id = fields.Many2one(
related='bom_id.location_id',
store=True,
)
location_id = fields.Many2one(related="bom_id.location_id", store=True)