[MIG] base_comment_template: Migration to 14.0 add unit test
[UPD] Update base_comment_template.pot [UPD] README.rstpull/664/head
parent
658003587b
commit
9fb52a9512
|
@ -13,14 +13,14 @@ Base Comments Templates
|
|||
.. |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%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
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
|
||||
: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-14-0/reporting-engine-14-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
|
||||
:target: https://runbot.odoo-community.org/runbot/143/14.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
@ -37,7 +37,7 @@ This module is the base module for following modules:
|
|||
* sale_comment_template
|
||||
* purchase_comment_template
|
||||
* invoice_comment_template
|
||||
|
||||
* stock_picking_comment_template
|
||||
|
||||
**Table of contents**
|
||||
|
||||
|
@ -47,10 +47,10 @@ This module is the base module for following modules:
|
|||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoice-reporting/issues>`_.
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/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 <https://github.com/OCA/account-invoice-reporting/issues/new?body=module:%20base_comment_template%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20base_comment_template%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
|
@ -70,7 +70,6 @@ Contributors
|
|||
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
|
||||
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
|
||||
* Simone Rubino <simone.rubino@agilebg.com>
|
||||
* Simone Rubino <simone.rubino@agilebg.com>
|
||||
* `DynApps <https://www.dynapps.be>`_:
|
||||
|
||||
* Raf Ven <raf.ven@dynapps.be>
|
||||
|
@ -78,7 +77,7 @@ Contributors
|
|||
* `Druidoo <https://www.druidoo.io>`_:
|
||||
|
||||
* Iván Todorovich <ivan.todorovich@druidoo.io>
|
||||
|
||||
* Pierre Verkest <pierreverkest84@gmail.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
@ -93,6 +92,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 <https://github.com/OCA/account-invoice-reporting/tree/14.0/base_comment_template>`_ project on GitHub.
|
||||
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/14.0/base_comment_template>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -6,7 +6,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: <>\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
@ -19,7 +19,7 @@ msgid "Active"
|
|||
msgstr ""
|
||||
|
||||
#. module: base_comment_template
|
||||
#: selection:base.comment.template,position:0
|
||||
#: model:ir.model.fields.selection,name:base_comment_template.selection__base_comment_template__position__after_lines
|
||||
msgid "After lines"
|
||||
msgstr ""
|
||||
|
||||
|
@ -29,7 +29,7 @@ msgid "Base comment template"
|
|||
msgstr ""
|
||||
|
||||
#. module: base_comment_template
|
||||
#: selection:base.comment.template,position:0
|
||||
#: model:ir.model.fields.selection,name:base_comment_template.selection__base_comment_template__position__before_lines
|
||||
msgid "Before lines"
|
||||
msgstr ""
|
||||
|
||||
|
@ -79,11 +79,13 @@ msgstr ""
|
|||
|
||||
#. module: base_comment_template
|
||||
#: model:ir.model.fields,field_description:base_comment_template.field_base_comment_template__display_name
|
||||
#: model:ir.model.fields,field_description:base_comment_template.field_res_partner__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_comment_template
|
||||
#: model:ir.model.fields,field_description:base_comment_template.field_base_comment_template__id
|
||||
#: model:ir.model.fields,field_description:base_comment_template.field_res_partner__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
|
@ -94,6 +96,7 @@ msgstr ""
|
|||
|
||||
#. module: base_comment_template
|
||||
#: model:ir.model.fields,field_description:base_comment_template.field_base_comment_template____last_update
|
||||
#: model:ir.model.fields,field_description:base_comment_template.field_res_partner____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
|
@ -121,4 +124,3 @@ msgstr ""
|
|||
#: model:ir.model.fields,help:base_comment_template.field_base_comment_template__position
|
||||
msgid "Position on document"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
|
||||
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
|
||||
* Simone Rubino <simone.rubino@agilebg.com>
|
||||
* Simone Rubino <simone.rubino@agilebg.com>
|
||||
* `DynApps <https://www.dynapps.be>`_:
|
||||
|
||||
* Raf Ven <raf.ven@dynapps.be>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/account-invoice-reporting/tree/12.0/base_comment_template"><img alt="OCA/account-invoice-reporting" src="https://img.shields.io/badge/github-OCA%2Faccount--invoice--reporting-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/94/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/14.0/base_comment_template"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-base_comment_template"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>Add a new model to define templates of comments to print on
|
||||
documents.</p>
|
||||
<p>Two positions are available for the comments:
|
||||
|
@ -378,6 +378,7 @@ documents.</p>
|
|||
<li>sale_comment_template</li>
|
||||
<li>purchase_comment_template</li>
|
||||
<li>invoice_comment_template</li>
|
||||
<li>stock_picking_comment_template</li>
|
||||
</ul>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
|
@ -393,10 +394,10 @@ documents.</p>
|
|||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-invoice-reporting/issues">GitHub Issues</a>.
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/OCA/account-invoice-reporting/issues/new?body=module:%20base_comment_template%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20base_comment_template%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
|
@ -415,7 +416,6 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||
<li>Yannick Vaucher <<a class="reference external" href="mailto:yannick.vaucher@camptocamp.com">yannick.vaucher@camptocamp.com</a>></li>
|
||||
<li>Guewen Baconnier <<a class="reference external" href="mailto:guewen.baconnier@camptocamp.com">guewen.baconnier@camptocamp.com</a>></li>
|
||||
<li>Simone Rubino <<a class="reference external" href="mailto:simone.rubino@agilebg.com">simone.rubino@agilebg.com</a>></li>
|
||||
<li>Simone Rubino <<a class="reference external" href="mailto:simone.rubino@agilebg.com">simone.rubino@agilebg.com</a>></li>
|
||||
<li><a class="reference external" href="https://www.dynapps.be">DynApps</a>:<ul>
|
||||
<li>Raf Ven <<a class="reference external" href="mailto:raf.ven@dynapps.be">raf.ven@dynapps.be</a>></li>
|
||||
</ul>
|
||||
|
@ -424,6 +424,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||
<li>Iván Todorovich <<a class="reference external" href="mailto:ivan.todorovich@druidoo.io">ivan.todorovich@druidoo.io</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Pierre Verkest <<a class="reference external" href="mailto:pierreverkest84@gmail.com">pierreverkest84@gmail.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
@ -433,7 +434,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||
<p>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.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-invoice-reporting/tree/12.0/base_comment_template">OCA/account-invoice-reporting</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/14.0/base_comment_template">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@ class TestResPartner(TransactionCase):
|
|||
{
|
||||
"name": "Comment before lines",
|
||||
"position": "before_lines",
|
||||
"text": "Text before lines",
|
||||
"text": "<p>Text before lines</p>",
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -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(), "<p>Text before lines</p>")
|
||||
|
||||
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": "<p>Testing translated fr_BE</p>"}
|
||||
)
|
||||
self.assertEqual(
|
||||
self.template_id.get_value(partner_id=partner.id),
|
||||
"<p>Testing translated fr_BE</p>",
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue