From 8ce386af1fda24060ea7a2a85996a548b4bb376d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=A7al=20Isern?= Date: Fri, 5 Jan 2018 10:00:48 +0100 Subject: [PATCH] [9.0] [MIG] mrp_bom_product_details (#187) --- mrp_bom_product_details/README.rst | 72 +++++++++++++++++++ mrp_bom_product_details/__init__.py | 24 +------ mrp_bom_product_details/__openerp__.py | 40 ++++------- mrp_bom_product_details/i18n/en_US.po | 63 ++++++++++++++++ mrp_bom_product_details/i18n/es.po | 65 +++++++++++++++++ mrp_bom_product_details/models/__init__.py | 5 ++ .../models/mrp_bom_product_details.py | 26 +++++++ .../mrp_bom_product_details.py | 35 --------- .../mrp_bom_product_details.xml | 42 ----------- .../views/mrp_bom_product_details.xml | 41 +++++++++++ 10 files changed, 287 insertions(+), 126 deletions(-) create mode 100644 mrp_bom_product_details/README.rst create mode 100644 mrp_bom_product_details/i18n/en_US.po create mode 100644 mrp_bom_product_details/i18n/es.po create mode 100644 mrp_bom_product_details/models/__init__.py create mode 100644 mrp_bom_product_details/models/mrp_bom_product_details.py delete mode 100644 mrp_bom_product_details/mrp_bom_product_details.py delete mode 100644 mrp_bom_product_details/mrp_bom_product_details.xml create mode 100644 mrp_bom_product_details/views/mrp_bom_product_details.xml diff --git a/mrp_bom_product_details/README.rst b/mrp_bom_product_details/README.rst new file mode 100644 index 000000000..871c13deb --- /dev/null +++ b/mrp_bom_product_details/README.rst @@ -0,0 +1,72 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +=================== +Bom product details +=================== + + +This module adds product price and stock to bom view. + + +Installation +============ + +To install this module, you just need to select the module and insure +yourself dependencies are available. + + + +Usage +===== + +* Go to Manufacturing > Products > Bill of Materials + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/129/9.0 + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + +Credits +======= + +Module developed and tested with Odoo version 9.0 +For questions, please contact our support services + +Images +------ + +* Odoo Community Association: `Icon `_. + + +Contributors +------------ + +* Solutions Libergia inc. +* QubiQ + + + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/mrp_bom_product_details/__init__.py b/mrp_bom_product_details/__init__.py index 1d82e0db7..13c500daf 100644 --- a/mrp_bom_product_details/__init__.py +++ b/mrp_bom_product_details/__init__.py @@ -1,23 +1,5 @@ # -*- coding: utf-8 -*- +# Copyright 2015 - Solutions Libergia inc. +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013 Solutions Libergia inc. (). -# -# 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 . -# -############################################################################## - -import mrp_bom_product_details +from . import models diff --git a/mrp_bom_product_details/__openerp__.py b/mrp_bom_product_details/__openerp__.py index 134f7dd70..6012f111e 100644 --- a/mrp_bom_product_details/__openerp__.py +++ b/mrp_bom_product_details/__openerp__.py @@ -1,36 +1,20 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013 Solutions Libergia inc. (). -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright 2017 Marsal Isern +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Bom product details', - 'version': '0.1', - 'author': "Solutions Libergia inc.,Odoo Community Association (OCA)", - 'license': 'GPL-3 or any later version', - 'category': 'Manufacturing', - 'description': """ + 'summary': """ This module adds product price and stock to bom view """, + 'version': '9.0.1.0.0', + 'author': "Solutions Libergia inc., " + "QubiQ, " + "Odoo Community Association (OCA)", + 'category': 'Manufacturing', 'depends': ["base", "mrp"], - 'demo': [], - 'data': ['mrp_bom_product_details.xml'], + 'license': 'AGPL-3', + 'data': ['views/mrp_bom_product_details.xml', ], 'auto_install': False, - 'installable': False, + 'installable': True, } diff --git a/mrp_bom_product_details/i18n/en_US.po b/mrp_bom_product_details/i18n/en_US.po new file mode 100644 index 000000000..b164bb6b4 --- /dev/null +++ b/mrp_bom_product_details/i18n/en_US.po @@ -0,0 +1,63 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_bom_product_details +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c-20160726\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-19 06:52+0000\n" +"PO-Revision-Date: 2017-04-19 06:52+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mrp_bom_product_details +#: model:ir.model,name:mrp_bom_product_details.model_mrp_bom +msgid "Bill of Material" +msgstr "Bill of Material" + +#. module: mrp_bom_product_details +#: model:ir.model.fields,field_description:mrp_bom_product_details.field_mrp_bom_line_product_standard_price +msgid "Cost" +msgstr "Cost" + +#. module: mrp_bom_product_details +#: model:ir.model.fields,field_description:mrp_bom_product_details.field_mrp_bom_product_standard_price +msgid "Cost Price" +msgstr "Cost Price" + +#. module: mrp_bom_product_details +#: model:ir.model.fields,help:mrp_bom_product_details.field_mrp_bom_line_product_standard_price +#: model:ir.model.fields,help:mrp_bom_product_details.field_mrp_bom_product_standard_price +msgid "Cost of the product template used for standard stock valuation in accounting and used as a base price on purchase orders. Expressed in the default unit of measure of the product." +msgstr "Cost of the product template used for standard stock valuation in accounting and used as a base price on purchase orders. Expressed in the default unit of measure of the product." + +#. module: mrp_bom_product_details +#: model:ir.model.fields,help:mrp_bom_product_details.field_mrp_bom_line_product_qty_available +#: model:ir.model.fields,help:mrp_bom_product_details.field_mrp_bom_product_qty_available +msgid "Current quantity of products.\n" +"In a context with a single Stock Location, this includes goods stored at this Location, or any of its children.\n" +"In a context with a single Warehouse, this includes goods stored in the Stock Location of this Warehouse, or any of its children.\n" +"stored in the Stock Location of the Warehouse of this Shop, or any of its children.\n" +"Otherwise, this includes goods stored in any Stock Location with 'internal' type." +msgstr "Current quantity of products.\n" +"In a context with a single Stock Location, this includes goods stored at this Location, or any of its children.\n" +"In a context with a single Warehouse, this includes goods stored in the Stock Location of this Warehouse, or any of its children.\n" +"stored in the Stock Location of the Warehouse of this Shop, or any of its children.\n" +"Otherwise, this includes goods stored in any Stock Location with 'internal' type." + +#. module: mrp_bom_product_details +#: model:ir.model.fields,field_description:mrp_bom_product_details.field_mrp_bom_line_product_qty_available +#: model:ir.model.fields,field_description:mrp_bom_product_details.field_mrp_bom_product_qty_available +msgid "Quantity On Hand" +msgstr "Quantity On Hand" + +#. module: mrp_bom_product_details +#: model:ir.model,name:mrp_bom_product_details.model_mrp_bom_line +msgid "mrp.bom.line" +msgstr "mrp.bom.line" + diff --git a/mrp_bom_product_details/i18n/es.po b/mrp_bom_product_details/i18n/es.po new file mode 100644 index 000000000..c3b701c4f --- /dev/null +++ b/mrp_bom_product_details/i18n/es.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_bom_product_details +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c-20160726\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-19 06:51+0000\n" +"PO-Revision-Date: 2017-04-19 08:59+0200\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"Language: es\n" +"X-Generator: Poedit 1.8.6\n" + +#. module: mrp_bom_product_details +#: model:ir.model,name:mrp_bom_product_details.model_mrp_bom +msgid "Bill of Material" +msgstr "Lista de materiales" + +#. module: mrp_bom_product_details +#: model:ir.model.fields,field_description:mrp_bom_product_details.field_mrp_bom_line_product_standard_price +msgid "Cost" +msgstr "Coste" + +#. module: mrp_bom_product_details +#: model:ir.model.fields,field_description:mrp_bom_product_details.field_mrp_bom_product_standard_price +msgid "Cost Price" +msgstr "Coste" + +#. module: mrp_bom_product_details +#: model:ir.model.fields,help:mrp_bom_product_details.field_mrp_bom_line_product_standard_price +#: model:ir.model.fields,help:mrp_bom_product_details.field_mrp_bom_product_standard_price +msgid "Cost of the product template used for standard stock valuation in accounting and used as a base price on purchase orders. Expressed in the default unit of measure of the product." +msgstr "Coste para la plantilla de producto usada para la valoración de existencias estándar en contabilidad, y utilizada como precio de referencia en órdenes de compra. Se expresa en la unidad de medida por defecto del producto." + +#. module: mrp_bom_product_details +#: model:ir.model.fields,help:mrp_bom_product_details.field_mrp_bom_line_product_qty_available +#: model:ir.model.fields,help:mrp_bom_product_details.field_mrp_bom_product_qty_available +msgid "" +"Current quantity of products.\n" +"In a context with a single Stock Location, this includes goods stored at this Location, or any of its children.\n" +"In a context with a single Warehouse, this includes goods stored in the Stock Location of this Warehouse, or any of its children.\n" +"stored in the Stock Location of the Warehouse of this Shop, or any of its children.\n" +"Otherwise, this includes goods stored in any Stock Location with 'internal' type." +msgstr "" +"Cantidad actual de los productos.\n" +"En un contexto de una sola ubicación de existencias, esto incluye los bienes almacenados en esta ubicación, o cualquiera de sus hijas.\n" +"En un contexto de un solo almacén, esto incluye los bienes almacenados en la ubicación de existencias de ese almacén, o cualquiera de sus hijas.\n" +"En cualquier otro caso, esto incluye los bienes almacenados en cualquier ubicación de existencias de tipo 'Interna'." + +#. module: mrp_bom_product_details +#: model:ir.model.fields,field_description:mrp_bom_product_details.field_mrp_bom_line_product_qty_available +#: model:ir.model.fields,field_description:mrp_bom_product_details.field_mrp_bom_product_qty_available +msgid "Quantity On Hand" +msgstr "Stock real" + +#. module: mrp_bom_product_details +#: model:ir.model,name:mrp_bom_product_details.model_mrp_bom_line +msgid "mrp.bom.line" +msgstr "mrp.bom.line" diff --git a/mrp_bom_product_details/models/__init__.py b/mrp_bom_product_details/models/__init__.py new file mode 100644 index 000000000..211089988 --- /dev/null +++ b/mrp_bom_product_details/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 - Solutions Libergia inc. +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import mrp_bom_product_details diff --git a/mrp_bom_product_details/models/mrp_bom_product_details.py b/mrp_bom_product_details/models/mrp_bom_product_details.py new file mode 100644 index 000000000..499ebce14 --- /dev/null +++ b/mrp_bom_product_details/models/mrp_bom_product_details.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 Oihane Crucelaegui - AvanzOSC +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openerp import fields, models + + +class MrpBom(models.Model): + _inherit = 'mrp.bom' + + product_standard_price = fields.Float( + related='product_id.standard_price', string='Cost Price', + readonly=True) + + product_qty_available = fields.Float( + related='product_id.qty_available', + string='Quantity On Hand', readonly=True) + + +class MrpBomLine(models.Model): + _inherit = 'mrp.bom.line' + + product_standard_price = fields.Float(related='product_id.standard_price', + readonly=True) + product_qty_available = fields.Float(related='product_id.qty_available', + readonly=True) diff --git a/mrp_bom_product_details/mrp_bom_product_details.py b/mrp_bom_product_details/mrp_bom_product_details.py deleted file mode 100644 index 07175e77d..000000000 --- a/mrp_bom_product_details/mrp_bom_product_details.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- - -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013 Solutions Libergia inc. (). -# -# 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 . -# -############################################################################## - -from openerp.osv import fields, orm - - -class mrp_bom(orm.Model): - _inherit = 'mrp.bom' - _columns = { - 'product_standard_price': fields.related( - 'product_id', 'standard_price', type='float', string='Cost Price', readonly=True - ), - 'product_qty_available': fields.related( - 'product_id', 'qty_available', type='float', string='Quantity On Hand', readonly=True - ), - } diff --git a/mrp_bom_product_details/mrp_bom_product_details.xml b/mrp_bom_product_details/mrp_bom_product_details.xml deleted file mode 100644 index 50f46bca6..000000000 --- a/mrp_bom_product_details/mrp_bom_product_details.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - mrp.bom.tree - mrp.bom - - - - - - - - - - - mrp.bom.component.tree - mrp.bom - - - - - - - - - - - mrp.bom.form - mrp.bom - - - - - - - - - - - diff --git a/mrp_bom_product_details/views/mrp_bom_product_details.xml b/mrp_bom_product_details/views/mrp_bom_product_details.xml new file mode 100644 index 000000000..b311eb3f3 --- /dev/null +++ b/mrp_bom_product_details/views/mrp_bom_product_details.xml @@ -0,0 +1,41 @@ + + + + mrp.bom.tree + mrp.bom + + + + + + + + + + + + mrp.bom.component.tree + mrp.bom.line + + + + + + + + + + + + + mrp.bom.form + mrp.bom + + + + + + + + +