From 6546e931ba13b3ced32283acaef2fa92be095ff9 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 17 Apr 2024 14:17:55 +0200 Subject: [PATCH] [ADD] sale_elaboration_weighing: New module TT47127 --- sale_elaboration_weighing/README.rst | 79 ++++ sale_elaboration_weighing/__init__.py | 2 + sale_elaboration_weighing/__manifest__.py | 22 + sale_elaboration_weighing/i18n/es.po | 61 +++ .../i18n/sale_elaboration_weighing.pot | 59 +++ sale_elaboration_weighing/models/__init__.py | 1 + .../models/stock_move.py | 21 + .../readme/CONTRIBUTORS.md | 3 + .../readme/DESCRIPTION.md | 1 + .../static/description/index.html | 424 ++++++++++++++++++ .../static/src/scss/stock_weighing.scss | 3 + .../views/stock_move_views.xml | 44 ++ sale_elaboration_weighing/wizards/__init__.py | 1 + .../wizards/weigh_operation_selection.py | 20 + .../odoo/addons/sale_elaboration_weighing | 1 + setup/sale_elaboration_weighing/setup.py | 6 + 16 files changed, 748 insertions(+) create mode 100644 sale_elaboration_weighing/README.rst create mode 100644 sale_elaboration_weighing/__init__.py create mode 100644 sale_elaboration_weighing/__manifest__.py create mode 100644 sale_elaboration_weighing/i18n/es.po create mode 100644 sale_elaboration_weighing/i18n/sale_elaboration_weighing.pot create mode 100644 sale_elaboration_weighing/models/__init__.py create mode 100644 sale_elaboration_weighing/models/stock_move.py create mode 100644 sale_elaboration_weighing/readme/CONTRIBUTORS.md create mode 100644 sale_elaboration_weighing/readme/DESCRIPTION.md create mode 100644 sale_elaboration_weighing/static/description/index.html create mode 100644 sale_elaboration_weighing/static/src/scss/stock_weighing.scss create mode 100644 sale_elaboration_weighing/views/stock_move_views.xml create mode 100644 sale_elaboration_weighing/wizards/__init__.py create mode 100644 sale_elaboration_weighing/wizards/weigh_operation_selection.py create mode 120000 setup/sale_elaboration_weighing/odoo/addons/sale_elaboration_weighing create mode 100644 setup/sale_elaboration_weighing/setup.py diff --git a/sale_elaboration_weighing/README.rst b/sale_elaboration_weighing/README.rst new file mode 100644 index 00000000..7b8f0ec6 --- /dev/null +++ b/sale_elaboration_weighing/README.rst @@ -0,0 +1,79 @@ +=============================== +Weighing assistant elaborations +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:324df009a628b8a0ec94181950618fe202af1d42ff3488a99145238b1b4408c1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fstock--weighing-lightgray.png?logo=github + :target: https://github.com/OCA/stock-weighing/tree/15.0/sale_elaboration_weighing + :alt: OCA/stock-weighing +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-weighing-15-0/stock-weighing-15-0-sale_elaboration_weighing + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-weighing&target_branch=15.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Show elaborations information and filters in the weighing assistant. + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Tecnativa + +Contributors +------------ + +- `Tecnativa `__ + + - David Vidal + - Sergio Teruel + +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/stock-weighing `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_elaboration_weighing/__init__.py b/sale_elaboration_weighing/__init__.py new file mode 100644 index 00000000..aee8895e --- /dev/null +++ b/sale_elaboration_weighing/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/sale_elaboration_weighing/__manifest__.py b/sale_elaboration_weighing/__manifest__.py new file mode 100644 index 00000000..83473236 --- /dev/null +++ b/sale_elaboration_weighing/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2024 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Weighing assistant elaborations", + "summary": "Weighing assistant extension for elaborations", + "version": "15.0.1.0.0", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-weighing", + "license": "AGPL-3", + "category": "Inventory", + "depends": [ + "stock_weighing", + "sale_elaboration", + ], + "data": ["views/stock_move_views.xml"], + "assets": { + "web.assets_backend": [ + "sale_elaboration_weighing/static/src/scss/stock_weighing.scss", + ], + }, + "installable": True, +} diff --git a/sale_elaboration_weighing/i18n/es.po b/sale_elaboration_weighing/i18n/es.po new file mode 100644 index 00000000..c5dfef44 --- /dev/null +++ b/sale_elaboration_weighing/i18n/es.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_elaboration_weighing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-17 10:58+0000\n" +"PO-Revision-Date: 2024-07-17 12:59+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.4.4\n" + +#. module: sale_elaboration_weighing +#: model_terms:ir.ui.view,arch_db:sale_elaboration_weighing.view_move_weight_kanban_view +msgid "" +msgstr "" + +#. module: sale_elaboration_weighing +#: model_terms:ir.ui.view,arch_db:sale_elaboration_weighing.view_move_search +msgid "Elaborated" +msgstr "Elaborado" + +#. module: sale_elaboration_weighing +#: code:addons/sale_elaboration_weighing/wizards/weigh_operation_selection.py:0 +#, python-format +msgid "Elaborations" +msgstr "Elaboraciones" + +#. module: sale_elaboration_weighing +#: model_terms:ir.ui.view,arch_db:sale_elaboration_weighing.view_move_search +msgid "Not elaborated" +msgstr "No elaborado" + +#. module: sale_elaboration_weighing +#: code:addons/sale_elaboration_weighing/wizards/weigh_operation_selection.py:0 +#, python-format +msgid "Outgoing elaborations" +msgstr "Elaboraciones salientes" + +#. module: sale_elaboration_weighing +#: model:ir.model,name:sale_elaboration_weighing.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de stock" + +#. module: sale_elaboration_weighing +#: code:addons/sale_elaboration_weighing/models/stock_move.py:0 +#, python-format +msgid "Weigh elaborations" +msgstr "Pesar elaboraciones" + +#. module: sale_elaboration_weighing +#: model:ir.model,name:sale_elaboration_weighing.model_weigh_operation_selection +msgid "weigh operation selection screen" +msgstr "pantalla de selección de operación de pesaje" diff --git a/sale_elaboration_weighing/i18n/sale_elaboration_weighing.pot b/sale_elaboration_weighing/i18n/sale_elaboration_weighing.pot new file mode 100644 index 00000000..7d6728cc --- /dev/null +++ b/sale_elaboration_weighing/i18n/sale_elaboration_weighing.pot @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_elaboration_weighing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-17 10:57+0000\n" +"PO-Revision-Date: 2024-07-17 10:57+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: sale_elaboration_weighing +#: model_terms:ir.ui.view,arch_db:sale_elaboration_weighing.view_move_weight_kanban_view +msgid "" +msgstr "" + +#. module: sale_elaboration_weighing +#: model_terms:ir.ui.view,arch_db:sale_elaboration_weighing.view_move_search +msgid "Elaborated" +msgstr "" + +#. module: sale_elaboration_weighing +#: code:addons/sale_elaboration_weighing/wizards/weigh_operation_selection.py:0 +#, python-format +msgid "Elaborations" +msgstr "" + +#. module: sale_elaboration_weighing +#: model_terms:ir.ui.view,arch_db:sale_elaboration_weighing.view_move_search +msgid "Not elaborated" +msgstr "" + +#. module: sale_elaboration_weighing +#: code:addons/sale_elaboration_weighing/wizards/weigh_operation_selection.py:0 +#, python-format +msgid "Outgoing elaborations" +msgstr "" + +#. module: sale_elaboration_weighing +#: model:ir.model,name:sale_elaboration_weighing.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: sale_elaboration_weighing +#: code:addons/sale_elaboration_weighing/models/stock_move.py:0 +#, python-format +msgid "Weigh elaborations" +msgstr "" + +#. module: sale_elaboration_weighing +#: model:ir.model,name:sale_elaboration_weighing.model_weigh_operation_selection +msgid "weigh operation selection screen" +msgstr "" diff --git a/sale_elaboration_weighing/models/__init__.py b/sale_elaboration_weighing/models/__init__.py new file mode 100644 index 00000000..6bda2d24 --- /dev/null +++ b/sale_elaboration_weighing/models/__init__.py @@ -0,0 +1 @@ +from . import stock_move diff --git a/sale_elaboration_weighing/models/stock_move.py b/sale_elaboration_weighing/models/stock_move.py new file mode 100644 index 00000000..a63dc861 --- /dev/null +++ b/sale_elaboration_weighing/models/stock_move.py @@ -0,0 +1,21 @@ +# Copyright 2024 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import _, api, models +from odoo.osv import expression + + +class StockMove(models.Model): + _inherit = "stock.move" + + @api.model + def action_sale_elaboration_weighing(self): + """Used in the start screen""" + action = self.action_outgoing_weighing_operations() + action["name"] = _("Weigh elaborations") + action["domain"] = expression.AND( + [ + action["domain"], + ["|", ("elaboration_note", "!=", ""), ("elaboration_ids", "!=", False)], + ] + ) + return action diff --git a/sale_elaboration_weighing/readme/CONTRIBUTORS.md b/sale_elaboration_weighing/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..295408bb --- /dev/null +++ b/sale_elaboration_weighing/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Tecnativa](https://www.tecnativa.com) + - David Vidal + - Sergio Teruel diff --git a/sale_elaboration_weighing/readme/DESCRIPTION.md b/sale_elaboration_weighing/readme/DESCRIPTION.md new file mode 100644 index 00000000..9e03c3c8 --- /dev/null +++ b/sale_elaboration_weighing/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Show elaborations information and filters in the weighing assistant. diff --git a/sale_elaboration_weighing/static/description/index.html b/sale_elaboration_weighing/static/description/index.html new file mode 100644 index 00000000..c1d684d3 --- /dev/null +++ b/sale_elaboration_weighing/static/description/index.html @@ -0,0 +1,424 @@ + + + + + +Weighing assistant elaborations + + + +
+

Weighing assistant elaborations

+ + +

Beta License: AGPL-3 OCA/stock-weighing Translate me on Weblate Try me on Runboat

+

Show elaborations information and filters in the weighing assistant.

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa
      +
    • David Vidal
    • +
    • Sergio Teruel
    • +
    +
  • +
+
+
+

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/stock-weighing project on GitHub.

+

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

+
+
+
+ + diff --git a/sale_elaboration_weighing/static/src/scss/stock_weighing.scss b/sale_elaboration_weighing/static/src/scss/stock_weighing.scss new file mode 100644 index 00000000..0ad32c2b --- /dev/null +++ b/sale_elaboration_weighing/static/src/scss/stock_weighing.scss @@ -0,0 +1,3 @@ +.o_elaboration_note { + @extend .alert-warning; +} diff --git a/sale_elaboration_weighing/views/stock_move_views.xml b/sale_elaboration_weighing/views/stock_move_views.xml new file mode 100644 index 00000000..e56e62a0 --- /dev/null +++ b/sale_elaboration_weighing/views/stock_move_views.xml @@ -0,0 +1,44 @@ + + + + + stock.move + + + + + + + + + + + + + + + + stock.move + + + + + + + + + + diff --git a/sale_elaboration_weighing/wizards/__init__.py b/sale_elaboration_weighing/wizards/__init__.py new file mode 100644 index 00000000..1b5a7d15 --- /dev/null +++ b/sale_elaboration_weighing/wizards/__init__.py @@ -0,0 +1 @@ +from . import weigh_operation_selection diff --git a/sale_elaboration_weighing/wizards/weigh_operation_selection.py b/sale_elaboration_weighing/wizards/weigh_operation_selection.py new file mode 100644 index 00000000..c35d76f6 --- /dev/null +++ b/sale_elaboration_weighing/wizards/weigh_operation_selection.py @@ -0,0 +1,20 @@ +# Copyright 2024 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import _, api, models + + +class WeightOperationSelection(models.TransientModel): + _inherit = "weigh.operation.selection" + + @api.model + def _get_weighing_start_screen_actions(self): + actions = super()._get_weighing_start_screen_actions() + actions.append( + { + "title": _("Elaborations"), + "description": _("Outgoing elaborations"), + "icon": "fa-cutlery", + "method": "action_sale_elaboration_weighing", + } + ) + return actions diff --git a/setup/sale_elaboration_weighing/odoo/addons/sale_elaboration_weighing b/setup/sale_elaboration_weighing/odoo/addons/sale_elaboration_weighing new file mode 120000 index 00000000..1cc5f230 --- /dev/null +++ b/setup/sale_elaboration_weighing/odoo/addons/sale_elaboration_weighing @@ -0,0 +1 @@ +../../../../sale_elaboration_weighing \ No newline at end of file diff --git a/setup/sale_elaboration_weighing/setup.py b/setup/sale_elaboration_weighing/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/sale_elaboration_weighing/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)