diff --git a/oca_dependencies.txt b/oca_dependencies.txt index ca3c726..e0f610c 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1 +1,2 @@ # See https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#oca_dependencies-txt +reporting-engine diff --git a/stock_picking_comment_template/README.rst b/stock_picking_comment_template/README.rst new file mode 100644 index 0000000..fe3a944 --- /dev/null +++ b/stock_picking_comment_template/README.rst @@ -0,0 +1,82 @@ +================ +Picking Comments +================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fstock--logistics--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-reporting/tree/14.0/stock_picking_comment_template + :alt: OCA/stock-logistics-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-reporting-14-0/stock-logistics-reporting-14-0-stock_picking_comment_template + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/151/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Adds comments on stock picking. +The comments can be added/edited from Inventory -> Configuration -> Document Comments + +**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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* C2i Change 2 improve + +Contributors +~~~~~~~~~~~~ + +* `C2i Change 2 improve `_: + + * Eduardo Magdalena + +* `NextERP Romania `_: + + * Fekete Mihai + +Do not contact contributors directly about support or help with technical issues. + +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-logistics-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_picking_comment_template/__init__.py b/stock_picking_comment_template/__init__.py new file mode 100644 index 0000000..83e553a --- /dev/null +++ b/stock_picking_comment_template/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/stock_picking_comment_template/__manifest__.py b/stock_picking_comment_template/__manifest__.py new file mode 100644 index 0000000..b214179 --- /dev/null +++ b/stock_picking_comment_template/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2019 C2i Change 2 improve - Eduardo Magdalena +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Picking Comments", + "summary": "Comments texts templates on Picking documents", + "version": "14.0.1.0.0", + "category": "Warehouse Management", + "website": "https://github.com/OCA/stock-logistics-reporting", + "author": "C2i Change 2 improve," "Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["stock", "base_comment_template"], + "data": [ + "views/base_comment_template_view.xml", + "views/report_delivery_document.xml", + "views/report_picking.xml", + "views/stock_picking_view.xml", + "security/ir.model.access.csv", + ], + "installable": True, +} diff --git a/stock_picking_comment_template/i18n/de.po b/stock_picking_comment_template/i18n/de.po new file mode 100644 index 0000000..099d606 --- /dev/null +++ b/stock_picking_comment_template/i18n/de.po @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-03-18 09:07+0000\n" +"Last-Translator: André Volksdorf \n" +"Language-Team: none\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 4.3.2\n" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__note2 +msgid "Bottom Comment" +msgstr "Suffix-Textbaustein" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__comment_template2_id +msgid "Bottom Comment Template" +msgstr "Suffix-Textbausteinvorlage" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Bottom Comments" +msgstr "Suffix-Textbausteine" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Comments" +msgstr "Textbausteine" + +#. module: stock_picking_comment_template +#: model:ir.model,name:stock_picking_comment_template.model_res_partner +msgid "Contact" +msgstr "Partner" + +#. module: stock_picking_comment_template +#: model:ir.ui.menu,name:stock_picking_comment_template.menu_base_comment_template_picking +msgid "Document Comments" +msgstr "Textbausteine" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Load a template" +msgstr "Textbausteinvorlage laden" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_res_partner__comment_template_id +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_res_users__comment_template_id +msgid "Picking conditions template" +msgstr "" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "The comments will be displayed on the printed document. You can load a predefined template, write your own text or load a template and then modify it only for this document." +msgstr "" +"Diese Textbausteine werden auf Dokumentbelegen gedruckt. Es kann eine " +"bereits existierende Vorlage geladen, ein neuer eigenständiger Text " +"geschrieben oder eine Vorlage nach dem Laden nur für dieses Dokument " +"angepasst werden." + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__note1 +msgid "Top Comment" +msgstr "Präfix-Textbaustein" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__comment_template1_id +msgid "Top Comment Template" +msgstr "Präfix-Textbausteinvorlage" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Top Comments" +msgstr "Präfix-Textbausteine" + +#. module: stock_picking_comment_template +#: model:ir.model,name:stock_picking_comment_template.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_comment_template/i18n/ja.po b/stock_picking_comment_template/i18n/ja.po new file mode 100644 index 0000000..407a508 --- /dev/null +++ b/stock_picking_comment_template/i18n/ja.po @@ -0,0 +1,89 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-07-05 04:43+0000\n" +"Last-Translator: Yoshi Tashiro \n" +"Language-Team: none\n" +"Language: ja\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" +"X-Generator: Weblate 3.7.1\n" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__note2 +msgid "Bottom Comment" +msgstr "下部コメント" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__comment_template2_id +msgid "Bottom Comment Template" +msgstr "下部コメントテンプレート" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Bottom Comments" +msgstr "下部コメント" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Comments" +msgstr "コメント" + +#. module: stock_picking_comment_template +#: model:ir.model,name:stock_picking_comment_template.model_res_partner +msgid "Contact" +msgstr "連絡先" + +#. module: stock_picking_comment_template +#: model:ir.ui.menu,name:stock_picking_comment_template.menu_base_comment_template_picking +msgid "Document Comments" +msgstr "ドキュメントコメント" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Load a template" +msgstr "テンプレートをロード" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_res_partner__comment_template_id +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_res_users__comment_template_id +#, fuzzy +msgid "Picking conditions template" +msgstr "条件テンプレート" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "" +"The comments will be displayed on the printed document. You can load a " +"predefined template, write your own text or load a template and then modify " +"it only for this document." +msgstr "" +"コメントは印刷されるドキュメントに表示されます。直接テキストを入力するか、既" +"存のテンプレートをロードして内容を修正するなどしてください。" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__note1 +msgid "Top Comment" +msgstr "上部コメント" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__comment_template1_id +msgid "Top Comment Template" +msgstr "上部コメントテンプレート" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Top Comments" +msgstr "上部コメント" + +#. module: stock_picking_comment_template +#: model:ir.model,name:stock_picking_comment_template.model_stock_picking +msgid "Transfer" +msgstr "運送" diff --git a/stock_picking_comment_template/i18n/stock_picking_comment_template.pot b/stock_picking_comment_template/i18n/stock_picking_comment_template.pot new file mode 100644 index 0000000..63eb758 --- /dev/null +++ b/stock_picking_comment_template/i18n/stock_picking_comment_template.pot @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__note2 +msgid "Bottom Comment" +msgstr "" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__comment_template2_id +msgid "Bottom Comment Template" +msgstr "" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Bottom Comments" +msgstr "" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Comments" +msgstr "" + +#. module: stock_picking_comment_template +#: model:ir.model,name:stock_picking_comment_template.model_res_partner +msgid "Contact" +msgstr "" + +#. module: stock_picking_comment_template +#: model:ir.ui.menu,name:stock_picking_comment_template.menu_base_comment_template_picking +msgid "Document Comments" +msgstr "" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Load a template" +msgstr "" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_res_partner__comment_template_id +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_res_users__comment_template_id +msgid "Picking conditions template" +msgstr "" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "The comments will be displayed on the printed document. You can load a predefined template, write your own text or load a template and then modify it only for this document." +msgstr "" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__note1 +msgid "Top Comment" +msgstr "" + +#. module: stock_picking_comment_template +#: model:ir.model.fields,field_description:stock_picking_comment_template.field_stock_picking__comment_template1_id +msgid "Top Comment Template" +msgstr "" + +#. module: stock_picking_comment_template +#: model_terms:ir.ui.view,arch_db:stock_picking_comment_template.stock_picking_form_add_comment +msgid "Top Comments" +msgstr "" + +#. module: stock_picking_comment_template +#: model:ir.model,name:stock_picking_comment_template.model_stock_picking +msgid "Transfer" +msgstr "" + diff --git a/stock_picking_comment_template/models/__init__.py b/stock_picking_comment_template/models/__init__.py new file mode 100644 index 0000000..ae4c272 --- /dev/null +++ b/stock_picking_comment_template/models/__init__.py @@ -0,0 +1 @@ +from . import stock_picking diff --git a/stock_picking_comment_template/models/stock_picking.py b/stock_picking_comment_template/models/stock_picking.py new file mode 100644 index 0000000..ff30df1 --- /dev/null +++ b/stock_picking_comment_template/models/stock_picking.py @@ -0,0 +1,9 @@ +# Copyright 2019 C2i Change 2 improve - Eduardo Magdalena +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class StockPicking(models.Model): + _inherit = ["stock.picking", "comment.template"] + _name = "stock.picking" diff --git a/stock_picking_comment_template/readme/CONTRIBUTORS.rst b/stock_picking_comment_template/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..d53f7c2 --- /dev/null +++ b/stock_picking_comment_template/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ +* `C2i Change 2 improve `_: + + * Eduardo Magdalena + +* `NextERP Romania `_: + + * Fekete Mihai + +Do not contact contributors directly about support or help with technical issues. diff --git a/stock_picking_comment_template/readme/DESCRIPTION.rst b/stock_picking_comment_template/readme/DESCRIPTION.rst new file mode 100644 index 0000000..cd26c7d --- /dev/null +++ b/stock_picking_comment_template/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +Adds comments on stock picking. +The comments can be added/edited from Inventory -> Configuration -> Document Comments diff --git a/stock_picking_comment_template/security/ir.model.access.csv b/stock_picking_comment_template/security/ir.model.access.csv new file mode 100644 index 0000000..ba945d5 --- /dev/null +++ b/stock_picking_comment_template/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_base_comment_template_stock_user,access_base_comment_template stock_user,base_comment_template.model_base_comment_template,stock.group_stock_user,1,0,0,0 +access_base_comment_template_stock_manager,access_base_comment_template stock_manager,base_comment_template.model_base_comment_template,stock.group_stock_manager,1,1,1,1 diff --git a/stock_picking_comment_template/static/description/icon.png b/stock_picking_comment_template/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/stock_picking_comment_template/static/description/icon.png differ diff --git a/stock_picking_comment_template/static/description/index.html b/stock_picking_comment_template/static/description/index.html new file mode 100644 index 0000000..cd8ce70 --- /dev/null +++ b/stock_picking_comment_template/static/description/index.html @@ -0,0 +1,428 @@ + + + + + + +Picking Comments + + + +
+

Picking Comments

+ + +

Beta License: AGPL-3 OCA/stock-logistics-reporting Translate me on Weblate Try me on Runbot

+

Adds comments on stock picking. +The comments can be added/edited from Inventory -> Configuration -> Document Comments

+

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

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • C2i Change 2 improve
  • +
+
+
+

Contributors

+ +

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

+
+
+

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-logistics-reporting project on GitHub.

+

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

+
+
+
+ + diff --git a/stock_picking_comment_template/tests/__init__.py b/stock_picking_comment_template/tests/__init__.py new file mode 100644 index 0000000..e93f797 --- /dev/null +++ b/stock_picking_comment_template/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_stock_picking_report diff --git a/stock_picking_comment_template/tests/test_stock_picking_report.py b/stock_picking_comment_template/tests/test_stock_picking_report.py new file mode 100644 index 0000000..b8d0db8 --- /dev/null +++ b/stock_picking_comment_template/tests/test_stock_picking_report.py @@ -0,0 +1,59 @@ +# Copyright 2019 C2i Change 2 improve - Eduardo Magdalena +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestStockPickingReport(TransactionCase): + def setUp(self): + super().setUp() + self.company = self.env.ref("base.main_company") + self.base_comment_model = self.env["base.comment.template"] + # Create comment related to sale model + self.picking_obj = self.env.ref("stock.model_stock_picking") + self.before_comment = self._create_comment(self.picking_obj, "before_lines") + self.after_comment = self._create_comment(self.picking_obj, "after_lines") + # Create partner + self.partner = self.env["res.partner"].create({"name": "Partner Test"}) + self.partner.base_comment_template_ids = [ + (4, self.before_comment.id), + (4, self.after_comment.id), + ] + self.picking_model = self.env["stock.picking"] + self.picking = self.picking_model.create( + { + "partner_id": self.partner.id, + "location_id": self.ref("stock.stock_location_stock"), + "location_dest_id": self.ref("stock.stock_location_customers"), + "picking_type_id": self.ref("stock.picking_type_out"), + } + ) + + def _create_comment(self, model, position): + return self.base_comment_model.create( + { + "name": "Comment " + position, + "company_id": self.company.id, + "position": position, + "text": "Text " + position, + "model_ids": [(6, 0, model.ids)], + } + ) + + def test_comments_in_deliveryslip(self): + res = ( + self.env["ir.actions.report"] + ._get_report_from_name("stock.report_deliveryslip") + ._render_qweb_html(self.picking.ids) + ) + self.assertRegex(str(res[0]), self.before_comment.text) + self.assertRegex(str(res[0]), self.after_comment.text) + + def test_comments_in_report_picking(self): + res = ( + self.env["ir.actions.report"] + ._get_report_from_name("stock.report_picking") + ._render_qweb_html(self.picking.ids) + ) + self.assertRegex(str(res[0]), self.before_comment.text) + self.assertRegex(str(res[0]), self.after_comment.text) diff --git a/stock_picking_comment_template/views/base_comment_template_view.xml b/stock_picking_comment_template/views/base_comment_template_view.xml new file mode 100644 index 0000000..f60d68d --- /dev/null +++ b/stock_picking_comment_template/views/base_comment_template_view.xml @@ -0,0 +1,26 @@ + + + + + Stock Picking Comment Templates + ir.actions.act_window + base.comment.template + tree,form + + + + + + + diff --git a/stock_picking_comment_template/views/report_delivery_document.xml b/stock_picking_comment_template/views/report_delivery_document.xml new file mode 100644 index 0000000..181c2fb --- /dev/null +++ b/stock_picking_comment_template/views/report_delivery_document.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/stock_picking_comment_template/views/report_picking.xml b/stock_picking_comment_template/views/report_picking.xml new file mode 100644 index 0000000..607ec75 --- /dev/null +++ b/stock_picking_comment_template/views/report_picking.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/stock_picking_comment_template/views/stock_picking_view.xml b/stock_picking_comment_template/views/stock_picking_view.xml new file mode 100644 index 0000000..4b997c8 --- /dev/null +++ b/stock_picking_comment_template/views/stock_picking_view.xml @@ -0,0 +1,17 @@ + + + + + comment_template.stock.picking.form + stock.picking + + + + + + + + + + +