diff --git a/mrp_workorder_sequence/README.rst b/mrp_workorder_sequence/README.rst new file mode 100644 index 000000000..4c55206fa --- /dev/null +++ b/mrp_workorder_sequence/README.rst @@ -0,0 +1,88 @@ +======================= +MRP Work Order Sequence +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github + :target: https://github.com/OCA/manufacture/tree/13.0/mrp_workorder_sequence + :alt: OCA/manufacture +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-mrp_workorder_sequence + :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/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Provide a new field sequence on production orders's work orders, that provides +clear information on the process order of those. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Go to any production order with a routing set and check its work orders. + +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 +~~~~~~~ + +* ForgeFlow + +Contributors +~~~~~~~~~~~~ + +* Lois Rilo +* Pimolnat Suntian + +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. + +.. |maintainer-LoisRForgeFlow| image:: https://github.com/LoisRForgeFlow.png?size=40px + :target: https://github.com/LoisRForgeFlow + :alt: LoisRForgeFlow + +Current `maintainer `__: + +|maintainer-LoisRForgeFlow| + +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_workorder_sequence/__init__.py b/mrp_workorder_sequence/__init__.py new file mode 100644 index 000000000..44f9fd7c1 --- /dev/null +++ b/mrp_workorder_sequence/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from . import models diff --git a/mrp_workorder_sequence/__manifest__.py b/mrp_workorder_sequence/__manifest__.py new file mode 100644 index 000000000..246d65b92 --- /dev/null +++ b/mrp_workorder_sequence/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +{ + "name": "MRP Work Order Sequence", + "summary": "adds sequence to production work orders.", + "version": "14.0.1.0.0", + "category": "Manufacturing", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "development_status": "Beta", + "maintainers": ["LoisRForgeFlow"], + "website": "https://github.com/OCA/manufacture", + "license": "LGPL-3", + "depends": ["mrp"], + "data": ["views/mrp_workorder_view.xml"], + "installable": True, +} diff --git a/mrp_workorder_sequence/i18n/mrp_workorder_sequence.pot b/mrp_workorder_sequence/i18n/mrp_workorder_sequence.pot new file mode 100644 index 000000000..77e19eb1a --- /dev/null +++ b/mrp_workorder_sequence/i18n/mrp_workorder_sequence.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_workorder_sequence +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.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_workorder_sequence +#: model:ir.model,name:mrp_workorder_sequence.model_mrp_production +msgid "Production Order" +msgstr "" + +#. module: mrp_workorder_sequence +#: model:ir.model.fields,field_description:mrp_workorder_sequence.field_mrp_workorder__sequence +msgid "Sequence" +msgstr "" + +#. module: mrp_workorder_sequence +#: model:ir.model,name:mrp_workorder_sequence.model_mrp_workorder +msgid "Work Order" +msgstr "" diff --git a/mrp_workorder_sequence/models/__init__.py b/mrp_workorder_sequence/models/__init__.py new file mode 100644 index 000000000..5a0ba17ab --- /dev/null +++ b/mrp_workorder_sequence/models/__init__.py @@ -0,0 +1,2 @@ +from . import mrp_production +from . import mrp_workorder diff --git a/mrp_workorder_sequence/models/mrp_production.py b/mrp_workorder_sequence/models/mrp_production.py new file mode 100644 index 000000000..762e0ba03 --- /dev/null +++ b/mrp_workorder_sequence/models/mrp_production.py @@ -0,0 +1,20 @@ +# Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import models + + +class MrpProduction(models.Model): + _inherit = "mrp.production" + + def _reset_work_order_sequence(self): + for rec in self: + current_sequence = 1 + for work in rec.workorder_ids: + work.sequence = current_sequence + current_sequence += 1 + + def _generate_workorders(self, exploded_boms): + res = super()._generate_workorders(exploded_boms) + self._reset_work_order_sequence() + return res diff --git a/mrp_workorder_sequence/models/mrp_workorder.py b/mrp_workorder_sequence/models/mrp_workorder.py new file mode 100644 index 000000000..e350595a5 --- /dev/null +++ b/mrp_workorder_sequence/models/mrp_workorder.py @@ -0,0 +1,10 @@ +# Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import fields, models + + +class MrpWorkOrder(models.Model): + _inherit = "mrp.workorder" + + sequence = fields.Integer() diff --git a/mrp_workorder_sequence/readme/CONTRIBUTORS.rst b/mrp_workorder_sequence/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..b40447fa0 --- /dev/null +++ b/mrp_workorder_sequence/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Lois Rilo +* Pimolnat Suntian diff --git a/mrp_workorder_sequence/readme/DESCRIPTION.rst b/mrp_workorder_sequence/readme/DESCRIPTION.rst new file mode 100644 index 000000000..38ab09bc0 --- /dev/null +++ b/mrp_workorder_sequence/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +Provide a new field sequence on production orders's work orders, that provides +clear information on the process order of those. diff --git a/mrp_workorder_sequence/readme/USAGE.rst b/mrp_workorder_sequence/readme/USAGE.rst new file mode 100644 index 000000000..5067d94df --- /dev/null +++ b/mrp_workorder_sequence/readme/USAGE.rst @@ -0,0 +1 @@ +Go to any production order with a routing set and check its work orders. diff --git a/mrp_workorder_sequence/static/description/icon.png b/mrp_workorder_sequence/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/mrp_workorder_sequence/static/description/icon.png differ diff --git a/mrp_workorder_sequence/static/description/index.html b/mrp_workorder_sequence/static/description/index.html new file mode 100644 index 000000000..69e97af37 --- /dev/null +++ b/mrp_workorder_sequence/static/description/index.html @@ -0,0 +1,428 @@ + + + + + + +MRP Work Order Sequence + + + +
+

MRP Work Order Sequence

+ + +

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

+

Provide a new field sequence on production orders’s work orders, that provides +clear information on the process order of those.

+

Table of contents

+ +
+

Usage

+

Go to any production order with a routing set and check its work orders.

+
+
+

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

+
    +
  • ForgeFlow
  • +
+
+
+

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.

+

Current maintainer:

+

LoisRForgeFlow

+

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_workorder_sequence/views/mrp_workorder_view.xml b/mrp_workorder_sequence/views/mrp_workorder_view.xml new file mode 100644 index 000000000..2514a7493 --- /dev/null +++ b/mrp_workorder_sequence/views/mrp_workorder_view.xml @@ -0,0 +1,16 @@ + + + + mrp.workorder.tree + mrp.workorder + + + + + + + + diff --git a/setup/mrp_workorder_sequence/odoo/addons/mrp_workorder_sequence b/setup/mrp_workorder_sequence/odoo/addons/mrp_workorder_sequence new file mode 120000 index 000000000..413aae71c --- /dev/null +++ b/setup/mrp_workorder_sequence/odoo/addons/mrp_workorder_sequence @@ -0,0 +1 @@ +../../../../mrp_workorder_sequence \ No newline at end of file diff --git a/setup/mrp_workorder_sequence/setup.py b/setup/mrp_workorder_sequence/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/mrp_workorder_sequence/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)