mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] mrp_bom_tracking: Migration to 13.0
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# Copyright 2019 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
|
||||
|
||||
{
|
||||
"name": "MRP BoM Tracking",
|
||||
"version": "12.0.1.0.0",
|
||||
"author": "Eficent, Odoo Community Association (OCA)",
|
||||
"version": "13.0.1.0.0",
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
"summary": "Logs any change to a BoM in the chatter",
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"category": "Manufacturing",
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# Copyright 2019 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class MrpBom(models.Model):
|
||||
_inherit = "mrp.bom"
|
||||
|
||||
code = fields.Char(track_visibility="onchange")
|
||||
product_tmpl_id = fields.Many2one(track_visibility="always")
|
||||
product_qty = fields.Float(track_visibility="onchange")
|
||||
picking_type_id = fields.Many2one(track_visibility="onchange")
|
||||
type = fields.Selection(track_visibility="onchange")
|
||||
code = fields.Char(tracking=True)
|
||||
product_id = fields.Many2one(tracking=True)
|
||||
product_tmpl_id = fields.Many2one(tracking=True)
|
||||
product_qty = fields.Float(tracking=True)
|
||||
picking_type_id = fields.Many2one(tracking=True)
|
||||
type = fields.Selection(tracking=True)
|
||||
|
||||
@api.multi
|
||||
def write(self, values):
|
||||
bom_line_ids = {}
|
||||
if "bom_line_ids" in values:
|
||||
@@ -48,7 +48,6 @@ class MrpBom(models.Model):
|
||||
class MrpBomLine(models.Model):
|
||||
_inherit = "mrp.bom.line"
|
||||
|
||||
@api.multi
|
||||
def write(self, values):
|
||||
if "product_id" in values:
|
||||
for bom in self.mapped("bom_id"):
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
* Miquel Raïch <miquel.raich@eficent.com>
|
||||
* Lois Rilo <lois.rilo@eficent.com>
|
||||
* Miquel Raïch <miquel.raich@forgeflow.com>
|
||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
* Joan Sisquella <joan.sisquella@forgeflow.com>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 2019 Eficent Business and IT Consulting Services S.L.
|
||||
# - Lois Rilo <lois.rilo@eficent.com>
|
||||
# Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# - Lois Rilo <lois.rilo@forgeflow.com>
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo.tests import common
|
||||
@@ -16,7 +16,6 @@ class TestBomTracking(common.SavepointCase):
|
||||
|
||||
# Create products:
|
||||
cls.product_1 = cls.product_obj.create({"name": "TEST 01", "type": "product"})
|
||||
|
||||
cls.component_1 = cls.product_obj.create({"name": "RM 01", "type": "product"})
|
||||
cls.component_2 = cls.product_obj.create({"name": "RM 02", "type": "product"})
|
||||
cls.component_2_alt = cls.product_obj.create(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2019 Eficent Business and IT Consulting Services S.L.
|
||||
<!-- Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). -->
|
||||
|
||||
<odoo>
|
||||
@@ -21,8 +21,9 @@
|
||||
<strong>The components have changed.</strong>
|
||||
<ul>
|
||||
<t t-foreach="lines" t-as="line">
|
||||
<li><t t-esc="line.product_id.display_name"/>:
|
||||
<t t-esc="mode"/> component<br/></li>
|
||||
<li><t t-esc="line.product_id.display_name"/>: <t t-esc="mode"/> component<br/></li>
|
||||
Product Quantity: <t t-esc="line.product_qty" /><br/>
|
||||
Product Unit of Measure: <t t-esc="line.product_uom_id.display_name" /><br/>
|
||||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user