diff --git a/sale_comment_template/README.rst b/sale_comment_template/README.rst new file mode 100644 index 000000000..abee8406c --- /dev/null +++ b/sale_comment_template/README.rst @@ -0,0 +1,127 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============= +Sale Comments +============= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:dd99371b699a05110f94c781b9d37626b159c2ad1006a29d73474694d871c8ea + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Fsale--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/sale-reporting/tree/19.0/sale_comment_template + :alt: OCA/sale-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-reporting-19-0/sale-reporting-19-0-sale_comment_template + :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/sale-reporting&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Adds comments on sales orders. The comments can be loaded from +templates. + +Adds comments on + +1. sales orders: + + The comments can be loaded from templates. + + Two positions are available for the comments: + + - above sale order lines + - below sale order lines + + Comments are copied on the invoice when you will create invoice from + sale order. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +To install this module, you need to have the module +account_comment_template, available in +`OCA/account-invoice-reporting `__. + +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 +------- + +* Camptocamp +* Tecnativa + +Contributors +------------ + +- Nicolas Bessi +- Yannick Vaucher +- Simone Rubino +- Xavier Jimenez +- `Tecnativa `__: + + - Pedro M. Baeza + - Vicent Cubells + - Vicent Martínez + +- `DynApps `__: + + - Raf Ven + +- `ForgeFlow `__: +- Miquel Raïch +- Pierre Verkest +- `Jarsa `__: + + - Alan Ramos + +- `Sygel `__: + + - Valentín Vinagre + - Roger Sans + +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/sale-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_comment_template/__init__.py b/sale_comment_template/__init__.py new file mode 100644 index 000000000..83e553ac4 --- /dev/null +++ b/sale_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/sale_comment_template/__manifest__.py b/sale_comment_template/__manifest__.py new file mode 100644 index 000000000..14f3ef508 --- /dev/null +++ b/sale_comment_template/__manifest__.py @@ -0,0 +1,26 @@ +# Copyright 2013-2014 Nicolas Bessi (Camptocamp SA) +# Copyright 2018 Qubiq - Xavier Jiménez +# Copyright 2018 Tecnativa - Pedro M. Baeza +# Copyright 2021 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Sale Comments", + "summary": "Comments texts templates on Sale documents", + "version": "19.0.1.0.0", + "category": "Sale", + "website": "https://github.com/OCA/sale-reporting", + "author": "Camptocamp, Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "depends": [ + "sale", + "account_comment_template", + ], + "data": [ + "views/sale_order_view.xml", + "views/base_comment_template_view.xml", + "views/report_saleorder.xml", + "security/ir.model.access.csv", + ], +} diff --git a/sale_comment_template/i18n/de.po b/sale_comment_template/i18n/de.po new file mode 100644 index 000000000..9c4951b9a --- /dev/null +++ b/sale_comment_template/i18n/de.po @@ -0,0 +1,82 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-23 15:13+0000\n" +"Last-Translator: Maria Sparenberg \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 3.10\n" + +#. module: sale_comment_template +#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order__comment_template_ids +msgid "Comment Template" +msgstr "" + +#. module: sale_comment_template +#: model_terms:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment +msgid "Comments" +msgstr "Textbausteine" + +#. module: sale_comment_template +#: model:ir.ui.menu,name:sale_comment_template.menu_base_comment_template_sale +msgid "Document Comments" +msgstr "Textbausteine" + +#. module: sale_comment_template +#: model:ir.actions.act_window,name:sale_comment_template.action_sale_order_comment_template +msgid "Sale Orders Comments" +msgstr "" + +#. module: sale_comment_template +#: model:ir.model,name:sale_comment_template.model_sale_order +msgid "Sales Order" +msgstr "" + +#~ msgid "Bottom Comment" +#~ msgstr "Suffix-Textbaustein" + +#~ msgid "Bottom Comment Template" +#~ msgstr "Suffix-Textbausteinvorlage" + +#~ msgid "Bottom Comments" +#~ msgstr "Suffix-Textbausteine" + +#~ msgid "Formatted Note" +#~ msgstr "Zusätzlicher Hinweis" + +#~ msgid "Load a template" +#~ msgstr "Textbausteinvorlage laden" + +#~ msgid "Sale Order" +#~ msgstr "Verkaufsauftrag" + +#~ msgid "Sales Order Line" +#~ msgstr "Auftragsposition" + +#~ 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." + +#~ msgid "Top Comment" +#~ msgstr "Präfix-Textbaustein" + +#~ msgid "Top Comment Template" +#~ msgstr "Präfix-Textbausteinvorlage" + +#~ msgid "Top Comments" +#~ msgstr "Präfix-Textbausteine" diff --git a/sale_comment_template/i18n/es.po b/sale_comment_template/i18n/es.po new file mode 100644 index 000000000..d808d2fc6 --- /dev/null +++ b/sale_comment_template/i18n/es.po @@ -0,0 +1,76 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-10-18 06:40+0000\n" +"PO-Revision-Date: 2023-09-03 13:40+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: \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" +"X-Generator: Weblate 4.17\n" + +#. module: sale_comment_template +#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order__comment_template_ids +msgid "Comment Template" +msgstr "Plantilla de comentario" + +#. module: sale_comment_template +#: model_terms:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment +msgid "Comments" +msgstr "Comentarios" + +#. module: sale_comment_template +#: model:ir.ui.menu,name:sale_comment_template.menu_base_comment_template_sale +msgid "Document Comments" +msgstr "Comentarios del documentos" + +#. module: sale_comment_template +#: model:ir.actions.act_window,name:sale_comment_template.action_sale_order_comment_template +msgid "Sale Orders Comments" +msgstr "Comentarios de órdenes de venta" + +#. module: sale_comment_template +#: model:ir.model,name:sale_comment_template.model_sale_order +msgid "Sales Order" +msgstr "Órdenes de venta" + +#~ msgid "Bottom Comment" +#~ msgstr "Comentario inferior" + +#~ msgid "Bottom Comment Template" +#~ msgstr "Plantilla del comentario inferior" + +#~ msgid "Bottom Comments" +#~ msgstr "Comentarios de la parte inferior" + +#~ msgid "Load a template" +#~ msgstr "Cargar una plantialla" + +#~ 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 "" +#~ "Los comentarios se mostrarán en los documentos impresos. Puede cargar una " +#~ "plantilla pedefinida, escribir su propio texto o cargar una plantilla y " +#~ "modificarla para este documento." + +#~ msgid "Top Comment" +#~ msgstr "Comentario superior" + +#~ msgid "Top Comment Template" +#~ msgstr "Plantilla del comentario superior" + +#~ msgid "Top Comments" +#~ msgstr "Comentarios de la parte superior" + +#~ msgid "Quotation" +#~ msgstr "Presupuesto" diff --git a/sale_comment_template/i18n/fr.po b/sale_comment_template/i18n/fr.po new file mode 100644 index 000000000..8491e3c24 --- /dev/null +++ b/sale_comment_template/i18n/fr.po @@ -0,0 +1,80 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-11-26 16:28+0000\n" +"PO-Revision-Date: 2014-10-22 08:13+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sale_comment_template +#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order__comment_template_ids +msgid "Comment Template" +msgstr "" + +#. module: sale_comment_template +#: model_terms:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment +msgid "Comments" +msgstr "Commentaires" + +#. module: sale_comment_template +#: model:ir.ui.menu,name:sale_comment_template.menu_base_comment_template_sale +msgid "Document Comments" +msgstr "Commentaires de documents" + +#. module: sale_comment_template +#: model:ir.actions.act_window,name:sale_comment_template.action_sale_order_comment_template +msgid "Sale Orders Comments" +msgstr "" + +#. module: sale_comment_template +#: model:ir.model,name:sale_comment_template.model_sale_order +msgid "Sales Order" +msgstr "" + +#~ msgid "Bottom Comment" +#~ msgstr "Commentaires du bas" + +#~ msgid "Bottom Comment Template" +#~ msgstr "Modèle de commentaire du bas" + +#~ msgid "Bottom Comments" +#~ msgstr "Commentaires du bas" + +#~ msgid "Load a template" +#~ msgstr "Utiliser un modèle" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Commande" + +#, fuzzy +#~ msgid "Sales Order Line" +#~ msgstr "Commande" + +#~ 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 "" +#~ "Les commentaires seront affichés sur le document imprimé. Vous pouvez " +#~ "charger un modèle prédéfini, écrire votre propre texte ou encore charger " +#~ "un modèle puis le modifier uniquement pour ce document." + +#~ msgid "Top Comment" +#~ msgstr "Commentaire du haut" + +#~ msgid "Top Comment Template" +#~ msgstr "Modèle de commentaire du haut" + +#~ msgid "Top Comments" +#~ msgstr "Commentaires du haut" diff --git a/sale_comment_template/i18n/it.po b/sale_comment_template/i18n/it.po new file mode 100644 index 000000000..97edc7d11 --- /dev/null +++ b/sale_comment_template/i18n/it.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-01-18 12:06+0000\n" +"Last-Translator: Francesco Foresti \n" +"Language-Team: none\n" +"Language: it\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.14.1\n" + +#. module: sale_comment_template +#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order__comment_template_ids +msgid "Comment Template" +msgstr "Modello commento" + +#. module: sale_comment_template +#: model_terms:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment +msgid "Comments" +msgstr "Commenti" + +#. module: sale_comment_template +#: model:ir.ui.menu,name:sale_comment_template.menu_base_comment_template_sale +msgid "Document Comments" +msgstr "Commenti del documento" + +#. module: sale_comment_template +#: model:ir.actions.act_window,name:sale_comment_template.action_sale_order_comment_template +msgid "Sale Orders Comments" +msgstr "Commenti ordini vendita" + +#. module: sale_comment_template +#: model:ir.model,name:sale_comment_template.model_sale_order +msgid "Sales Order" +msgstr "Ordine di vendita" + +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" + +#~ msgid "Bottom Comment" +#~ msgstr "Commento in basso" + +#~ msgid "Bottom Comment Template" +#~ msgstr "Modello commento in basso" + +#~ msgid "Bottom Comments" +#~ msgstr "Commenti in basso" + +#~ msgid "Formatted Note" +#~ msgstr "Nota formattata" + +#~ msgid "Load a template" +#~ msgstr "Carica un modello" + +#~ msgid "Sale Order" +#~ msgstr "Ordine di vendita" + +#~ msgid "Sales Order Line" +#~ msgstr "Riga ordine di vendita" + +#~ 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 "" +#~ "I commenti saranno mostrati sul documento stampato. Puoi caricare un " +#~ "modello predefinito, scrivi il tuo testo o carica un modello e poi " +#~ "modificalo solo per questo documento." + +#~ msgid "Top Comment" +#~ msgstr "Commento in alto" + +#~ msgid "Top Comment Template" +#~ msgstr "Modello commento in alto" + +#~ msgid "Top Comments" +#~ msgstr "Commenti in alto" diff --git a/sale_comment_template/i18n/pt.po b/sale_comment_template/i18n/pt.po new file mode 100644 index 000000000..88523df1f --- /dev/null +++ b/sale_comment_template/i18n/pt.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-23 15:13+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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.10\n" + +#. module: sale_comment_template +#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order__comment_template_ids +msgid "Comment Template" +msgstr "" + +#. module: sale_comment_template +#: model_terms:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment +msgid "Comments" +msgstr "Comentários" + +#. module: sale_comment_template +#: model:ir.ui.menu,name:sale_comment_template.menu_base_comment_template_sale +msgid "Document Comments" +msgstr "Comentários do Documento" + +#. module: sale_comment_template +#: model:ir.actions.act_window,name:sale_comment_template.action_sale_order_comment_template +msgid "Sale Orders Comments" +msgstr "" + +#. module: sale_comment_template +#: model:ir.model,name:sale_comment_template.model_sale_order +msgid "Sales Order" +msgstr "" + +#~ msgid "Bottom Comment" +#~ msgstr "Comentários de Fundo" + +#~ msgid "Bottom Comment Template" +#~ msgstr "Modelo de Comentários de Fundo" + +#~ msgid "Bottom Comments" +#~ msgstr "Comentários de Fundo" + +#~ msgid "Formatted Note" +#~ msgstr "Nota Formatada" + +#~ msgid "Load a template" +#~ msgstr "Carregar um modelo" + +#~ msgid "Sale Order" +#~ msgstr "Encomenda de Venda" + +#~ msgid "Sales Order Line" +#~ msgstr "Linha de Encomenda de Venda" + +#~ 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 "" +#~ "Os comentários serão exibidos no documento impresso. Pode carregar um " +#~ "modelo predefinido, escrever o seu próprio texto ou carregar um modelo e " +#~ "depois modificá-lo apenas para este documento." + +#~ msgid "Top Comment" +#~ msgstr "Comentário de Topo" + +#~ msgid "Top Comment Template" +#~ msgstr "Modelo de Comentário de Topo" + +#~ msgid "Top Comments" +#~ msgstr "Comentários de Topo" diff --git a/sale_comment_template/i18n/sale_comment_template.pot b/sale_comment_template/i18n/sale_comment_template.pot new file mode 100644 index 000000000..2bf375300 --- /dev/null +++ b/sale_comment_template/i18n/sale_comment_template.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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: sale_comment_template +#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order__comment_template_ids +msgid "Comment Template" +msgstr "" + +#. module: sale_comment_template +#: model_terms:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment +msgid "Comments" +msgstr "" + +#. module: sale_comment_template +#: model:ir.ui.menu,name:sale_comment_template.menu_base_comment_template_sale +msgid "Document Comments" +msgstr "" + +#. module: sale_comment_template +#: model:ir.actions.act_window,name:sale_comment_template.action_sale_order_comment_template +msgid "Sale Orders Comments" +msgstr "" + +#. module: sale_comment_template +#: model:ir.model,name:sale_comment_template.model_sale_order +msgid "Sales Order" +msgstr "" diff --git a/sale_comment_template/models/__init__.py b/sale_comment_template/models/__init__.py new file mode 100644 index 000000000..d12c5efdb --- /dev/null +++ b/sale_comment_template/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import sale_order diff --git a/sale_comment_template/models/sale_order.py b/sale_comment_template/models/sale_order.py new file mode 100644 index 000000000..f08f05e71 --- /dev/null +++ b/sale_comment_template/models/sale_order.py @@ -0,0 +1,10 @@ +# Copyright 2013-2014 Nicolas Bessi (Camptocamp SA) +# Copyright 2021 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class SaleOrder(models.Model): + _name = "sale.order" + _inherit = ["sale.order", "comment.template"] diff --git a/sale_comment_template/pyproject.toml b/sale_comment_template/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/sale_comment_template/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_comment_template/readme/CONTRIBUTORS.md b/sale_comment_template/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..b84974af4 --- /dev/null +++ b/sale_comment_template/readme/CONTRIBUTORS.md @@ -0,0 +1,18 @@ +- Nicolas Bessi \<\> +- Yannick Vaucher \<\> +- Simone Rubino \<\> +- Xavier Jimenez \<\> +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - Vicent Cubells + - Vicent Martínez +- [DynApps](https://www.dynapps.be): + - Raf Ven \<\> +- [ForgeFlow](https://www.forgeflow.com): +- Miquel Raïch \<\> +- Pierre Verkest \<\> +- [Jarsa](https://www.jarsa.com): + - Alan Ramos \<\> +- [Sygel](https://www.sygel.es): + - Valentín Vinagre \<\> + - Roger Sans \<\> \ No newline at end of file diff --git a/sale_comment_template/readme/DESCRIPTION.md b/sale_comment_template/readme/DESCRIPTION.md new file mode 100644 index 000000000..7dec1993e --- /dev/null +++ b/sale_comment_template/readme/DESCRIPTION.md @@ -0,0 +1,16 @@ +Adds comments on sales orders. The comments can be loaded from +templates. + +Adds comments on + +1. sales orders: + + The comments can be loaded from templates. + + Two positions are available for the comments: + + - above sale order lines + - below sale order lines + + Comments are copied on the invoice when you will create invoice from + sale order. diff --git a/sale_comment_template/readme/INSTALL.md b/sale_comment_template/readme/INSTALL.md new file mode 100644 index 000000000..0a4490592 --- /dev/null +++ b/sale_comment_template/readme/INSTALL.md @@ -0,0 +1,3 @@ +To install this module, you need to have the module +account_comment_template, available in +[OCA/account-invoice-reporting](https://github.com/OCA/account-invoice-reporting). diff --git a/sale_comment_template/security/ir.model.access.csv b/sale_comment_template/security/ir.model.access.csv new file mode 100644 index 000000000..3548fd447 --- /dev/null +++ b/sale_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_sale_user,access_base_comment_template sale user,base_comment_template.model_base_comment_template,sales_team.group_sale_salesman,1,0,0,0 +access_base_comment_template_sale_manager,access_base_comment_template sale manager,base_comment_template.model_base_comment_template,sales_team.group_sale_manager,1,1,1,1 diff --git a/sale_comment_template/static/description/icon.png b/sale_comment_template/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/sale_comment_template/static/description/icon.png differ diff --git a/sale_comment_template/static/description/index.html b/sale_comment_template/static/description/index.html new file mode 100644 index 000000000..8911aae72 --- /dev/null +++ b/sale_comment_template/static/description/index.html @@ -0,0 +1,476 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Sale Comments

+ +

Beta License: AGPL-3 OCA/sale-reporting Translate me on Weblate Try me on Runboat

+

Adds comments on sales orders. The comments can be loaded from +templates.

+

Adds comments on

+
    +
  1. sales orders:

    +

    The comments can be loaded from templates.

    +

    Two positions are available for the comments:

    +
      +
    • above sale order lines
    • +
    • below sale order lines
    • +
    +

    Comments are copied on the invoice when you will create invoice from +sale order.

    +
  2. +
+

Table of contents

+ +
+

Installation

+

To install this module, you need to have the module +account_comment_template, available in +OCA/account-invoice-reporting.

+
+
+

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

+
    +
  • Camptocamp
  • +
  • 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/sale-reporting project on GitHub.

+

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

+
+
+
+
+ + diff --git a/sale_comment_template/tests/__init__.py b/sale_comment_template/tests/__init__.py new file mode 100644 index 000000000..a1feb17d4 --- /dev/null +++ b/sale_comment_template/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_sale_order_report diff --git a/sale_comment_template/tests/test_sale_order_report.py b/sale_comment_template/tests/test_sale_order_report.py new file mode 100644 index 000000000..fa5f640f7 --- /dev/null +++ b/sale_comment_template/tests/test_sale_order_report.py @@ -0,0 +1,92 @@ +# Copyright 2017 Simone Rubino - Agile Business Group +# Copyright 2018 Tecnativa - Pedro M. Baeza +# Copyright 2021 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests import Form, TransactionCase + + +class TestAccountInvoiceReport(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.company = cls.env.ref("base.main_company") + cls.base_comment_model = cls.env["base.comment.template"] + # Create comment related to sale model + cls.sale_before_comment = cls._create_comment_sale_template( + cls, "sale.order", "before_lines" + ) + cls.sale_after_comment = cls._create_comment_sale_template( + cls, "sale.order", "after_lines" + ) + # Create comment related to move model + cls.move_before_comment = cls._create_comment_sale_template( + cls, "account.move", "before_lines" + ) + cls.move_after_comment = cls._create_comment_sale_template( + cls, "account.move", "after_lines" + ) + # Create partner + cls.partner = cls.env["res.partner"].create({"name": "Partner Test"}) + cls.partner.base_comment_template_ids = [ + (4, cls.sale_before_comment.id), + (4, cls.sale_after_comment.id), + (4, cls.move_before_comment.id), + (4, cls.move_after_comment.id), + ] + cls.product = cls.env["product.product"].create( + { + "name": "Test product", + "sale_ok": True, + "type": "service", + "list_price": 10, + "invoice_policy": "order", + } + ) + cls.sale_order = cls._create_sale_order(cls) + cls.sale_order.action_confirm() + + def _create_sale_order(self): + sale_form = Form(self.env["sale.order"]) + sale_form.partner_id = self.partner + with sale_form.order_line.new() as line_form: + line_form.product_id = self.product + return sale_form.save() + + def _create_comment_sale_template(self, models, position): + return self.base_comment_model.create( + { + "name": "Comment " + position, + "company_id": self.company.id, + "position": position, + "text": "Text " + position, + "models": models, + } + ) + + def test_comments_in_sale_order_report(self): + self.sale_order._compute_comment_template_ids() + res = self.env["ir.actions.report"]._render_qweb_html( + "sale.report_saleorder", self.sale_order.ids + ) + self.assertRegex(str(res[0]), self.sale_before_comment.text) + self.assertRegex(str(res[0]), self.sale_after_comment.text) + + def test_comments_in_generated_invoice(self): + invoice = self.sale_order._create_invoices()[0] + self.assertTrue(self.move_before_comment in invoice.comment_template_ids) + self.assertTrue(self.move_after_comment in invoice.comment_template_ids) + self.assertFalse(self.sale_before_comment in invoice.comment_template_ids) + self.assertFalse(self.sale_after_comment in invoice.comment_template_ids) + res = self.env["ir.actions.report"]._render_qweb_html( + "account.report_invoice", invoice.ids + ) + self.assertRegex(str(res[0]), self.move_before_comment.text) + self.assertRegex(str(res[0]), self.move_after_comment.text) + + def test_comments_in_sale_order(self): + self.sale_order._compute_comment_template_ids() + self.assertTrue(self.sale_after_comment in self.sale_order.comment_template_ids) + self.assertTrue( + self.sale_before_comment in self.sale_order.comment_template_ids + ) diff --git a/sale_comment_template/views/base_comment_template_view.xml b/sale_comment_template/views/base_comment_template_view.xml new file mode 100644 index 000000000..717a8b8fa --- /dev/null +++ b/sale_comment_template/views/base_comment_template_view.xml @@ -0,0 +1,17 @@ + + + + Sale Orders Comments + ir.actions.act_window + base.comment.template + list,form + [("model_ids", "=", "sale.order")] + + + + diff --git a/sale_comment_template/views/report_saleorder.xml b/sale_comment_template/views/report_saleorder.xml new file mode 100644 index 000000000..452caea5d --- /dev/null +++ b/sale_comment_template/views/report_saleorder.xml @@ -0,0 +1,24 @@ + + + + diff --git a/sale_comment_template/views/sale_order_view.xml b/sale_comment_template/views/sale_order_view.xml new file mode 100644 index 000000000..09a92eb3a --- /dev/null +++ b/sale_comment_template/views/sale_order_view.xml @@ -0,0 +1,15 @@ + + + + comment_template.sale.order.form + sale.order + + + + + + + + + +