From ca7130d0851a84ff78a34b10d286f70190c4eef7 Mon Sep 17 00:00:00 2001 From: Matteo Boscolo Date: Fri, 19 Apr 2024 15:47:57 +0200 Subject: [PATCH] IMP: add nuw weight filed on bom --- plm_automatic_weight/models/__init__.py | 1 + plm_automatic_weight/models/mrp_bom_line.py | 36 +++++++++++++++++++++ plm_automatic_weight/views/mrp_bom.xml | 13 ++++++++ 3 files changed, 50 insertions(+) create mode 100755 plm_automatic_weight/models/mrp_bom_line.py diff --git a/plm_automatic_weight/models/__init__.py b/plm_automatic_weight/models/__init__.py index de9b75f8..29289e67 100755 --- a/plm_automatic_weight/models/__init__.py +++ b/plm_automatic_weight/models/__init__.py @@ -26,3 +26,4 @@ """ from . import product_product from . import mrp_bom +from . import mrp_bom_line diff --git a/plm_automatic_weight/models/mrp_bom_line.py b/plm_automatic_weight/models/mrp_bom_line.py new file mode 100755 index 00000000..93237c4d --- /dev/null +++ b/plm_automatic_weight/models/mrp_bom_line.py @@ -0,0 +1,36 @@ +############################################################################## +# +# OmniaSolutions, Open Source Management Solution +# Copyright (C) 2010-2011 OmniaSolutions (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +""" +Created on 13 Jun 2016 + +@author: Daniel Smerghetto +""" +from odoo import models +from odoo import fields + + +class MrpBomLine(models.Model): + _name = 'mrp.bom.line' + _inherit = 'mrp.bom.line' + + product_automatic_compute_selection = fields.Selection(related="product_id.automatic_compute_selection") + diff --git a/plm_automatic_weight/views/mrp_bom.xml b/plm_automatic_weight/views/mrp_bom.xml index f1412287..bedfe1c5 100755 --- a/plm_automatic_weight/views/mrp_bom.xml +++ b/plm_automatic_weight/views/mrp_bom.xml @@ -8,4 +8,17 @@ env['mrp.bom'].browse(env.context.get('active_ids', [])).force_compute_bom_weight() + + + plm.aw.mrp.bom.form.view + mrp.bom + + form + + + + + + +