diff --git a/base_comment_template/README.rst b/base_comment_template/README.rst index 16a15ad5..e7ab2a23 100644 --- a/base_comment_template/README.rst +++ b/base_comment_template/README.rst @@ -14,10 +14,10 @@ Base Comments Templates :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoice--reporting-lightgray.png?logo=github - :target: https://github.com/OCA/account-invoice-reporting/tree/14.0/base_comment_template - :alt: OCA/account-invoice-reporting + :target: https://github.com/OCA/reporting-engine/tree/14.0/base_comment_template + :alt: OCA/reporting-engine .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template + :target: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-base_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/94/14.0 @@ -47,10 +47,10 @@ This module is the base module for following modules: Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -93,6 +93,6 @@ 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/account-invoice-reporting `_ project on GitHub. +This module is part of the `OCA/reporting-engine `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/base_comment_template/__manifest__.py b/base_comment_template/__manifest__.py index f5408320..9a4af1bf 100644 --- a/base_comment_template/__manifest__.py +++ b/base_comment_template/__manifest__.py @@ -6,7 +6,7 @@ "summary": "Comments templates on documents", "version": "14.0.1.0.0", "category": "Sale", - "website": "https://github.com/OCA/account-invoice-reporting", + "website": "https://github.com/OCA/reporting-engine", "author": "Camptocamp, Odoo Community Association (OCA)", "license": "AGPL-3", "installable": True, diff --git a/base_comment_template/models/comment.py b/base_comment_template/models/comment.py index f139c60e..a8b6c85b 100644 --- a/base_comment_template/models/comment.py +++ b/base_comment_template/models/comment.py @@ -45,4 +45,4 @@ class BaseCommentTemplate(models.Model): lang = None if partner_id: lang = self.env["res.partner"].browse(partner_id).lang - return self.with_context({"lang": lang}).text + return self.with_context(lang=lang).text diff --git a/base_comment_template/readme/CONTRIBUTORS.rst b/base_comment_template/readme/CONTRIBUTORS.rst index 22be356c..b5394276 100644 --- a/base_comment_template/readme/CONTRIBUTORS.rst +++ b/base_comment_template/readme/CONTRIBUTORS.rst @@ -3,7 +3,6 @@ * Yannick Vaucher * Guewen Baconnier * Simone Rubino -* Simone Rubino * `DynApps `_: * Raf Ven diff --git a/base_comment_template/readme/DESCRIPTION.rst b/base_comment_template/readme/DESCRIPTION.rst old mode 100755 new mode 100644 index 291a014c..4b538a9f --- a/base_comment_template/readme/DESCRIPTION.rst +++ b/base_comment_template/readme/DESCRIPTION.rst @@ -10,3 +10,4 @@ This module is the base module for following modules: * sale_comment_template * purchase_comment_template * invoice_comment_template +* stock_picking_comment_template diff --git a/base_comment_template/static/description/index.html b/base_comment_template/static/description/index.html index bd152368..c0b8eb73 100644 --- a/base_comment_template/static/description/index.html +++ b/base_comment_template/static/description/index.html @@ -1,13 +1,15 @@ - - - -Base Comments Templates - - - -
-

Base Comments Templates

- - -

Beta License: AGPL-3 OCA/account-invoice-reporting Translate me on Weblate Try me on Runbot

-

Add a new model to define templates of comments to print on -documents.

-

Two positions are available for the comments: -* above document lines -* below document lines

-

This module is the base module for following modules:

-
    -
  • sale_comment_template
  • -
  • purchase_comment_template
  • -
  • invoice_comment_template
  • -
-

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

-
    -
  • Camptocamp
  • -
-
-
-

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/account-invoice-reporting project on GitHub.

-

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

-
-
-
- +

+ Beta + License: AGPL-3 + OCA/reporting-engine + Translate me on Weblate + Try me on Runbot +

+

Add a new model to define templates of comments to print on documents.

+

+ Two positions are available for the comments: * above document lines * below + document lines +

+

This module is the base module for following modules:

+
    +
  • sale_comment_template
  • +
  • purchase_comment_template
  • +
  • invoice_comment_template
  • +
+

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

+
    +
  • Camptocamp
  • +
+
+
+

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/reporting-engine + project on GitHub. +

+

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

+
+
+ + diff --git a/base_comment_template/tests/test_base_comment_template.py b/base_comment_template/tests/test_base_comment_template.py index 319fab33..a803974c 100644 --- a/base_comment_template/tests/test_base_comment_template.py +++ b/base_comment_template/tests/test_base_comment_template.py @@ -9,7 +9,7 @@ class TestResPartner(TransactionCase): { "name": "Comment before lines", "position": "before_lines", - "text": "Text before lines", + "text": "

Text before lines

", } ) @@ -20,3 +20,18 @@ class TestResPartner(TransactionCase): # Test childs propagation of commercial partner field for child_id in partner_id.child_ids: self.assertEqual(child_id.property_comment_template_id, self.template_id) + + def test_get_value_without_partner(self): + self.assertEqual(self.template_id.get_value(), "

Text before lines

") + + def test_get_value_with_partner(self): + self.env["res.lang"]._activate_lang("fr_BE") + partner = self.env.ref("base.res_partner_12") + partner.write({"lang": "fr_BE"}) + self.template_id.with_context(lang="fr_BE").write( + {"text": "

Testing translated fr_BE

"} + ) + self.assertEqual( + self.template_id.get_value(partner_id=partner.id), + "

Testing translated fr_BE

", + ) diff --git a/setup/base_comment_template/odoo/addons/base_comment_template b/setup/base_comment_template/odoo/addons/base_comment_template new file mode 120000 index 00000000..e1637e73 --- /dev/null +++ b/setup/base_comment_template/odoo/addons/base_comment_template @@ -0,0 +1 @@ +../../../../base_comment_template \ No newline at end of file diff --git a/setup/base_comment_template/setup.py b/setup/base_comment_template/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/base_comment_template/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)