diff --git a/mrp_sale_info/README.rst b/mrp_sale_info/README.rst new file mode 100644 index 000000000..b6ae67b4f --- /dev/null +++ b/mrp_sale_info/README.rst @@ -0,0 +1,93 @@ +============= +MRP Sale Info +============= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github + :target: https://github.com/OCA/manufacture/tree/12.0/mrp_sale_info + :alt: OCA/manufacture +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-mrp_sale_info + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/129/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of Odoo for adding related fields to +Manufacturing Orders and Work Orders: + + * Sale order + * Customer + * Commitment Date + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +New fields are displayed in tree and in form views (Extra information tab). + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* AvanzOSC +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `AvanzOsc `_: + + * Oihane Crucelaegui + * Ana Juaristi +* `Tecnativa `_: + + * Antonio Espinosa + * Rafael Blasco + * Pedro M. Baeza +* Rubén Bravo + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +This module is part of the `OCA/manufacture `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mrp_sale_info/__init__.py b/mrp_sale_info/__init__.py new file mode 100644 index 000000000..3ea0e1bf2 --- /dev/null +++ b/mrp_sale_info/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2019 Rubén Bravo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/mrp_sale_info/__manifest__.py b/mrp_sale_info/__manifest__.py new file mode 100644 index 000000000..1bff5fff9 --- /dev/null +++ b/mrp_sale_info/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2019 Rubén Bravo +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "MRP Sale Info", + "summary": "Adds sale information to Manufacturing models", + "version": "12.0.1.0.0", + "category": "Manufacturing", + "website": "https://github.com/oca/manufacture", + "author": "AvanzOSC, " + "Tecnativa, " + "Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + 'installable': True, + "depends": [ + "mrp", + "sale_stock", + ], + "data": [ + "views/mrp_production.xml", + "views/mrp_workorder.xml", + ] +} diff --git a/mrp_sale_info/i18n/de.po b/mrp_sale_info/i18n/de.po new file mode 100644 index 000000000..fca1d8721 --- /dev/null +++ b/mrp_sale_info/i18n/de.po @@ -0,0 +1,62 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_sale_info +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: manufacture (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-14 11:03+0000\n" +"PO-Revision-Date: 2018-12-13 11:58+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-manufacture-9-0/" +"language/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.3\n" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "Commitment Date" +msgstr "Zusagedatum" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_partner_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_partner_id +msgid "Customer" +msgstr "Kunde" + +#. module: mrp_sale_info +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "" +"Date by which the products are sure to be delivered. This is a date that you " +"can promise to the customer, based on the Product Lead Times." +msgstr "" +"Datum, zu dem die Produkte sicher geliefert werden können. Dieses Datum " +"können Sie einem Kunden, basierend auf Vorlauf- und Lieferzeiten, zusagen." + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_production +msgid "Manufacturing Order" +msgstr "Fertigungsauftrag" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_sale_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_sale_id +msgid "Sale order" +msgstr "Verkaufsauftrag" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_workorder +msgid "Work Order" +msgstr "Arbeitsauftrag" + +#~ msgid "Sale Information" +#~ msgstr "Verkaufsinformation" diff --git a/mrp_sale_info/i18n/es.po b/mrp_sale_info/i18n/es.po new file mode 100644 index 000000000..a3b1039c7 --- /dev/null +++ b/mrp_sale_info/i18n/es.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_sale_info +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: manufacture (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-12 23:17+0000\n" +"PO-Revision-Date: 2016-03-12 23:17+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-manufacture-9-0/" +"language/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "Commitment Date" +msgstr "Fecha compromiso" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_partner_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_partner_id +msgid "Customer" +msgstr "Cliente" + +#. module: mrp_sale_info +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "" +"Date by which the products are sure to be delivered. This is a date that you " +"can promise to the customer, based on the Product Lead Times." +msgstr "" +"Fecha en la que se asegura que los productos estarán enviados. Esta es la " +"fecha de compromiso con el cliente, basada en el tirmpo de entrega." + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_production +msgid "Manufacturing Order" +msgstr "Orden de producción" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_sale_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_sale_id +msgid "Sale order" +msgstr "Pedido de venta" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_workorder +msgid "Work Order" +msgstr "Orden de trabajo" + +#~ msgid "Sale Information" +#~ msgstr "Información de venta" diff --git a/mrp_sale_info/i18n/fr.po b/mrp_sale_info/i18n/fr.po new file mode 100644 index 000000000..8c148917d --- /dev/null +++ b/mrp_sale_info/i18n/fr.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_sale_info +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: manufacture (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-07 07:44+0000\n" +"PO-Revision-Date: 2016-03-12 23:17+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/OCA-manufacture-9-0/" +"language/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "Commitment Date" +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_partner_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_partner_id +msgid "Customer" +msgstr "Client" + +#. module: mrp_sale_info +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "" +"Date by which the products are sure to be delivered. This is a date that you " +"can promise to the customer, based on the Product Lead Times." +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_sale_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_sale_id +msgid "Sale order" +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_workorder +msgid "Work Order" +msgstr "" diff --git a/mrp_sale_info/i18n/mrp_sale_info.pot b/mrp_sale_info/i18n/mrp_sale_info.pot new file mode 100644 index 000000000..ac62e70a5 --- /dev/null +++ b/mrp_sale_info/i18n/mrp_sale_info.pot @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_sale_info +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \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_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "Commitment Date" +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_partner_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_partner_id +msgid "Customer" +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "Date by which the products are sure to be delivered. This is a date that you can promise to the customer, based on the Product Lead Times." +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_sale_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_sale_id +msgid "Sale order" +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_workorder +msgid "Work Order" +msgstr "" + diff --git a/mrp_sale_info/i18n/pt_BR.po b/mrp_sale_info/i18n/pt_BR.po new file mode 100644 index 000000000..eaea87fde --- /dev/null +++ b/mrp_sale_info/i18n/pt_BR.po @@ -0,0 +1,62 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_sale_info +# +# Translators: +# Claudio Araujo Santos , 2016 +msgid "" +msgstr "" +"Project-Id-Version: manufacture (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-03 06:08+0000\n" +"PO-Revision-Date: 2016-07-07 19:51+0000\n" +"Last-Translator: Claudio Araujo Santos \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-" +"manufacture-9-0/language/pt_BR/)\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "Commitment Date" +msgstr "Compromisso Data" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_partner_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_partner_id +msgid "Customer" +msgstr "Cliente" + +#. module: mrp_sale_info +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "" +"Date by which the products are sure to be delivered. This is a date that you " +"can promise to the customer, based on the Product Lead Times." +msgstr "" +"Data em que os produtos estão certos para serem entregues. Esta é uma data " +"que você pode prometer para o cliente, com base nos prazos de entrega do " +"produto." + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_production +msgid "Manufacturing Order" +msgstr "Ordem de fabricação" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_sale_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_sale_id +msgid "Sale order" +msgstr "Ordem de venda" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_workorder +msgid "Work Order" +msgstr "Ordem de trabalho" + +#~ msgid "Sale Information" +#~ msgstr "Informações venda" diff --git a/mrp_sale_info/i18n/zh_CN.po b/mrp_sale_info/i18n/zh_CN.po new file mode 100644 index 000000000..edee1c558 --- /dev/null +++ b/mrp_sale_info/i18n/zh_CN.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_sale_info +# +# Translators: +# Jeffery Chenn , 2016 +msgid "" +msgstr "" +"Project-Id-Version: manufacture (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-07 07:44+0000\n" +"PO-Revision-Date: 2016-09-04 05:46+0000\n" +"Last-Translator: Jeffery Chenn \n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-" +"manufacture-9-0/language/zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "Commitment Date" +msgstr "提交日期" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_partner_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_partner_id +msgid "Customer" +msgstr "客户" + +#. module: mrp_sale_info +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_production_commitment_date +#: model:ir.model.fields,help:mrp_sale_info.field_mrp_workorder_commitment_date +msgid "" +"Date by which the products are sure to be delivered. This is a date that you " +"can promise to the customer, based on the Product Lead Times." +msgstr "" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_production +msgid "Manufacturing Order" +msgstr "制造订单" + +#. module: mrp_sale_info +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_sale_id +#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_sale_id +msgid "Sale order" +msgstr "销售订单" + +#. module: mrp_sale_info +#: model:ir.model,name:mrp_sale_info.model_mrp_workorder +msgid "Work Order" +msgstr "工单" + +#~ msgid "Sale Information" +#~ msgstr "销售信息" diff --git a/mrp_sale_info/models/__init__.py b/mrp_sale_info/models/__init__.py new file mode 100644 index 000000000..ab9fed971 --- /dev/null +++ b/mrp_sale_info/models/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import mrp_production +from . import mrp_workorder +from . import stock_rule diff --git a/mrp_sale_info/models/mrp_production.py b/mrp_sale_info/models/mrp_production.py new file mode 100644 index 000000000..c6a0bc054 --- /dev/null +++ b/mrp_sale_info/models/mrp_production.py @@ -0,0 +1,23 @@ +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2019 Rubén Bravo +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class MrpProduction(models.Model): + _inherit = "mrp.production" + + source_procurement_group_id = fields.Many2one( + comodel_name='procurement.group', readonly=True, + ) + sale_id = fields.Many2one( + comodel_name='sale.order', string='Sale order', readonly=True, + store=True, related='source_procurement_group_id.sale_id') + partner_id = fields.Many2one( + comodel_name='res.partner', related='sale_id.partner_id', + string='Customer', store=True) + commitment_date = fields.Datetime( + related='sale_id.commitment_date', string='Commitment Date', + store=True) diff --git a/mrp_sale_info/models/mrp_workorder.py b/mrp_sale_info/models/mrp_workorder.py new file mode 100644 index 000000000..e9126a376 --- /dev/null +++ b/mrp_sale_info/models/mrp_workorder.py @@ -0,0 +1,17 @@ +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2019 Rubén Bravo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class MrpWorkorder(models.Model): + _inherit = "mrp.workorder" + + sale_id = fields.Many2one(related='production_id.sale_id', + string='Sale order', readonly=True, store=True) + partner_id = fields.Many2one(related='sale_id.partner_id', readonly=True, + string='Customer', store=True) + commitment_date = fields.Datetime(related='sale_id.commitment_date', + string='Commitment Date', store=True, + readonly=True) diff --git a/mrp_sale_info/models/stock_rule.py b/mrp_sale_info/models/stock_rule.py new file mode 100644 index 000000000..f01c845f3 --- /dev/null +++ b/mrp_sale_info/models/stock_rule.py @@ -0,0 +1,19 @@ +# Copyright 2019 Rubén Bravo +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import models + + +class StockRule(models.Model): + _inherit = 'stock.rule' + + def _prepare_mo_vals(self, product_id, product_qty, product_uom, + location_id, name, origin, values, bom): + res = super()._prepare_mo_vals( + product_id, product_qty, product_uom, location_id, name, + origin, values, bom + ) + res["source_procurement_group_id"] = values.get( + "group_id").id if values.get('group_id', False) else False + return res diff --git a/mrp_sale_info/readme/CONTRIBUTORS.rst b/mrp_sale_info/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..df5ff81b9 --- /dev/null +++ b/mrp_sale_info/readme/CONTRIBUTORS.rst @@ -0,0 +1,10 @@ +* `AvanzOsc `_: + + * Oihane Crucelaegui + * Ana Juaristi +* `Tecnativa `_: + + * Antonio Espinosa + * Rafael Blasco + * Pedro M. Baeza +* Rubén Bravo diff --git a/mrp_sale_info/readme/DESCRIPTION.rst b/mrp_sale_info/readme/DESCRIPTION.rst new file mode 100644 index 000000000..71735399c --- /dev/null +++ b/mrp_sale_info/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +This module extends the functionality of Odoo for adding related fields to +Manufacturing Orders and Work Orders: + + * Sale order + * Customer + * Commitment Date diff --git a/mrp_sale_info/readme/USAGE.rst b/mrp_sale_info/readme/USAGE.rst new file mode 100644 index 000000000..e4863f588 --- /dev/null +++ b/mrp_sale_info/readme/USAGE.rst @@ -0,0 +1 @@ +New fields are displayed in tree and in form views (Extra information tab). diff --git a/mrp_sale_info/static/description/icon.png b/mrp_sale_info/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/mrp_sale_info/static/description/icon.png differ diff --git a/mrp_sale_info/static/description/index.html b/mrp_sale_info/static/description/index.html new file mode 100644 index 000000000..fa984cca8 --- /dev/null +++ b/mrp_sale_info/static/description/index.html @@ -0,0 +1,444 @@ + + + + + + +MRP Sale Info + + + +
+

MRP Sale Info

+ + +

Beta License: AGPL-3 OCA/manufacture Translate me on Weblate Try me on Runbot

+

This module extends the functionality of Odoo for adding related fields to +Manufacturing Orders and Work Orders:

+
+
    +
  • Sale order
  • +
  • Customer
  • +
  • Commitment Date
  • +
+
+

Table of contents

+ +
+

Usage

+

New fields are displayed in tree and in form views (Extra information tab).

+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • AvanzOSC
  • +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/manufacture project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mrp_sale_info/tests/__init__.py b/mrp_sale_info/tests/__init__.py new file mode 100644 index 000000000..b73700e8c --- /dev/null +++ b/mrp_sale_info/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_mrp_sale_info diff --git a/mrp_sale_info/tests/test_mrp_sale_info.py b/mrp_sale_info/tests/test_mrp_sale_info.py new file mode 100644 index 000000000..a467d7b8d --- /dev/null +++ b/mrp_sale_info/tests/test_mrp_sale_info.py @@ -0,0 +1,39 @@ +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests import common + + +class TestMrpSaleInfo(common.SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.product = cls.env["product.product"].create({ + "name": "Test mrp_sale_info product", + "type": "product", + "route_ids": [ + (4, cls.env.ref("mrp.route_warehouse0_manufacture").id), + (4, cls.env.ref("stock.route_warehouse0_mto").id), + ], + }) + cls.bom = cls.env["mrp.bom"].create({ + "product_tmpl_id": cls.product.product_tmpl_id.id, + }) + cls.partner = cls.env["res.partner"].create({"name": "Test client"}) + cls.sale_order = cls.env["sale.order"].create({ + "partner_id": cls.partner.id, + "order_line": [ + (0, 0, { + "product_id": cls.product.id, + "product_uom_qty": 1, + "price_unit": 1, + }), + ] + }) + + def test_mrp_sale_info(self): + prev_productions = self.env["mrp.production"].search([]) + self.sale_order.action_confirm() + production = self.env["mrp.production"].search([]) - prev_productions + self.assertEqual(production.sale_id, self.sale_order) + self.assertEqual(production.partner_id, self.partner) diff --git a/mrp_sale_info/views/mrp_production.xml b/mrp_sale_info/views/mrp_production.xml new file mode 100644 index 000000000..93d4357f6 --- /dev/null +++ b/mrp_sale_info/views/mrp_production.xml @@ -0,0 +1,29 @@ + + + + MRP Production Form with Sale Order + mrp.production + + + + + + + + + + + + MRP Production Tree with Sale Order + mrp.production + + + + + + + + + + + diff --git a/mrp_sale_info/views/mrp_workorder.xml b/mrp_sale_info/views/mrp_workorder.xml new file mode 100644 index 000000000..8d7317605 --- /dev/null +++ b/mrp_sale_info/views/mrp_workorder.xml @@ -0,0 +1,29 @@ + + + + MRP Work Order Tree with Sale Order + mrp.workorder + + + + + + + + + + + + MRP Work Order Form with Sale Order + mrp.workorder + + + + + + + + + + +