From 52a3c6b76c812e220b783d5267570a4e37a7491a Mon Sep 17 00:00:00 2001 From: Ruben Dario Bravo Date: Sun, 14 Apr 2019 12:08:57 -0400 Subject: [PATCH] [MIG] mrp_sale_info: Migration to 12.0 --- mrp_sale_info/README.rst | 80 ++-- mrp_sale_info/__init__.py | 1 + mrp_sale_info/__manifest__.py | 4 +- mrp_sale_info/models/__init__.py | 2 + mrp_sale_info/models/mrp_production.py | 1 + mrp_sale_info/models/mrp_workorder.py | 1 + mrp_sale_info/models/stock_rule.py | 20 + mrp_sale_info/readme/CONTRIBUTORS.rst | 6 + mrp_sale_info/readme/DESCRIPTION.rst | 5 + mrp_sale_info/readme/USAGE.rst | 1 + mrp_sale_info/static/description/index.html | 437 ++++++++++++++++++++ mrp_sale_info/views/mrp_workorder.xml | 8 +- 12 files changed, 530 insertions(+), 36 deletions(-) create mode 100644 mrp_sale_info/models/stock_rule.py create mode 100644 mrp_sale_info/readme/CONTRIBUTORS.rst create mode 100644 mrp_sale_info/readme/DESCRIPTION.rst create mode 100644 mrp_sale_info/readme/USAGE.rst create mode 100644 mrp_sale_info/static/description/index.html diff --git a/mrp_sale_info/README.rst b/mrp_sale_info/README.rst index 248ced437..1d957b70b 100644 --- a/mrp_sale_info/README.rst +++ b/mrp_sale_info/README.rst @@ -1,68 +1,88 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ============= 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 sale_mrp and adds related fields to Manufacturing Orders and Work Orders: - * Sale order - * Customer - * Commitment Date + * Sale order + * Customer + * Commitment Date + +**Table of contents** + +.. contents:: + :local: Usage ===== New fields are displayed in tree and in form views (Extra information tab). -.. 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/11.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 -`_. +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 ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* AvanzOSC +* Tecnativa Contributors ------------- +~~~~~~~~~~~~ * Rafael Blasco * Antonio Espinosa -* Javier Iniesta * Oihane Crucelaegui * Pedro M. Baeza * Ana Juaristi -* Victor M. Martin +* Rubén Bravo -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. 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. +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 index 8018c4c84..3ea0e1bf2 100644 --- a/mrp_sale_info/__init__.py +++ b/mrp_sale_info/__init__.py @@ -1,4 +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 index 67d2a6dfe..4690c3a69 100644 --- a/mrp_sale_info/__manifest__.py +++ b/mrp_sale_info/__manifest__.py @@ -1,9 +1,10 @@ # 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). { "name": "MRP Sale Info", "summary": "Adds sale information to Manufacturing models", - "version": "11.0.1.0.0", + "version": "12.0.1.0.0", "category": "Manufacturing", "website": "https://github.com/oca/manufacture", "author": "AvanzOSC, " @@ -15,7 +16,6 @@ "depends": [ "mrp", "sale_mrp", - "sale_order_dates", "stock", "sale_stock", ], diff --git a/mrp_sale_info/models/__init__.py b/mrp_sale_info/models/__init__.py index 2618c7645..86876ac3e 100644 --- a/mrp_sale_info/models/__init__.py +++ b/mrp_sale_info/models/__init__.py @@ -1,5 +1,7 @@ # 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 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 index cfb01ee80..70685823e 100644 --- a/mrp_sale_info/models/mrp_production.py +++ b/mrp_sale_info/models/mrp_production.py @@ -1,4 +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 odoo import fields, models diff --git a/mrp_sale_info/models/mrp_workorder.py b/mrp_sale_info/models/mrp_workorder.py index fa3a1490c..e9126a376 100644 --- a/mrp_sale_info/models/mrp_workorder.py +++ b/mrp_sale_info/models/mrp_workorder.py @@ -1,4 +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 odoo import fields, models diff --git a/mrp_sale_info/models/stock_rule.py b/mrp_sale_info/models/stock_rule.py new file mode 100644 index 000000000..a5f45bfc1 --- /dev/null +++ b/mrp_sale_info/models/stock_rule.py @@ -0,0 +1,20 @@ +# Copyright 2019 Rubén Bravo +# 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.update({ + '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..5e01a9e1f --- /dev/null +++ b/mrp_sale_info/readme/CONTRIBUTORS.rst @@ -0,0 +1,6 @@ +* Rafael Blasco +* Antonio Espinosa +* Oihane Crucelaegui +* Pedro M. Baeza +* Ana Juaristi +* 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..96287accf --- /dev/null +++ b/mrp_sale_info/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module extends the functionality of sale_mrp and adds 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/index.html b/mrp_sale_info/static/description/index.html new file mode 100644 index 000000000..1dae47924 --- /dev/null +++ b/mrp_sale_info/static/description/index.html @@ -0,0 +1,437 @@ + + + + + + +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 sale_mrp and adds 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/views/mrp_workorder.xml b/mrp_sale_info/views/mrp_workorder.xml index c1e16b47d..8d7317605 100644 --- a/mrp_sale_info/views/mrp_workorder.xml +++ b/mrp_sale_info/views/mrp_workorder.xml @@ -1,9 +1,9 @@ - + MRP Work Order Tree with Sale Order mrp.workorder - + @@ -13,10 +13,10 @@ - + MRP Work Order Form with Sale Order mrp.workorder - +