forked from OCA/multi-company
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR OCA#498 into 16.0 via patch
- Loading branch information
1 parent
2cf618e
commit a2ddf91
Showing
19 changed files
with
748 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
=========================== | ||
Mail Template Multi Company | ||
=========================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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%2Fmulti--company-lightgray.png?logo=github | ||
:target: https://github.com/OCA/multi-company/tree/15.0/mail_template_multi_company | ||
:alt: OCA/multi-company | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/multi-company-15-0/multi-company-15-0-mail_template_multi_company | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/133/15.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module add multi-company management to mail templates. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
* Go to *Settings > General Settings* | ||
* Activate the multi-company | ||
* Go to *Settings > User & Companies > Users* | ||
* Select your user to edit it and active the multi-company | ||
|
||
Usage | ||
===== | ||
|
||
* Go to *Settings* | ||
* Activate the developer mode | ||
* Go to *Settings > Technical > Email > Templates* | ||
* Open a template and set the company field if the template is specific to a | ||
company | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/multi-company/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/multi-company/issues/new?body=module:%20mail_template_multi_company%0Aversion:%2015.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. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* ACSONE SA/NV | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Olivier Laurent <[email protected]> | ||
* Souheil Bejaoui <[email protected]> | ||
* Andrea Stirpe <[email protected]> | ||
|
||
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. | ||
|
||
.. |maintainer-Olivier-LAURENT| image:: https://github.com/Olivier-LAURENT.png?size=40px | ||
:target: https://github.com/Olivier-LAURENT | ||
:alt: Olivier-LAURENT | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-Olivier-LAURENT| | ||
|
||
This module is part of the `OCA/multi-company <https://github.com/OCA/multi-company/tree/15.0/mail_template_multi_company>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from . import models | ||
|
||
|
||
def post_init_hook(cr, registry): | ||
"""We should not set the company by default on all existing mail templates | ||
when installing this module. Because many standard template need not be | ||
specialized by company. | ||
OTOH, when this module is installed it makes sense that new templates | ||
being created by users have a company set by default.""" | ||
cr.execute("UPDATE mail_template SET company_id=null") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2017 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Mail Template Multi Company", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "ACSONE SA/NV," "Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/multi-company", | ||
"depends": ["mail"], | ||
"post_init_hook": "post_init_hook", | ||
"data": ["security/mail_template.xml", "views/mail_template.xml"], | ||
"development_status": "Beta", | ||
"maintainers": ["Olivier-LAURENT"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mail_template_multi_company | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2021-03-09 17:45+0000\n" | ||
"Last-Translator: Ana Suárez <[email protected]>\n" | ||
"Language-Team: none\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.3.2\n" | ||
|
||
#. module: mail_template_multi_company | ||
#: model:ir.model.fields,field_description:mail_template_multi_company.field_mail_template__company_id | ||
msgid "Company" | ||
msgstr "Compañía" | ||
|
||
#. module: mail_template_multi_company | ||
#: model:ir.model,name:mail_template_multi_company.model_mail_template | ||
msgid "Email Templates" | ||
msgstr "Plantillas de email" |
24 changes: 24 additions & 0 deletions
24
mail_template_multi_company/i18n/mail_template_multi_company.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mail_template_multi_company | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.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: mail_template_multi_company | ||
#: model:ir.model.fields,field_description:mail_template_multi_company.field_mail_template__company_id | ||
msgid "Company" | ||
msgstr "" | ||
|
||
#. module: mail_template_multi_company | ||
#: model:ir.model,name:mail_template_multi_company.model_mail_template | ||
msgid "Email Templates" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mail_template_multi_company | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-06-23 19:09+0000\n" | ||
"Last-Translator: Bosd <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: nl\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: mail_template_multi_company | ||
#: model:ir.model.fields,field_description:mail_template_multi_company.field_mail_template__company_id | ||
msgid "Company" | ||
msgstr "Bedrijf" | ||
|
||
#. module: mail_template_multi_company | ||
#: model:ir.model,name:mail_template_multi_company.model_mail_template | ||
msgid "Email Templates" | ||
msgstr "Email Sjablonen" |
14 changes: 14 additions & 0 deletions
14
mail_template_multi_company/migrations/13.0.1.0.0/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import SUPERUSER_ID, api | ||
|
||
|
||
def migrate(cr, version): | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
domain = "['|',('company_id','=',False),('company_id','in',company_ids)]" | ||
rule = env.ref( | ||
"mail_template_multi_company.mail_template_company_rule", | ||
raise_if_not_found=False, | ||
) | ||
if rule: | ||
rule.write({"domain_force": domain}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import mail_template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2017 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class MailTemplate(models.Model): | ||
|
||
_inherit = "mail.template" | ||
|
||
company_id = fields.Many2one( | ||
"res.company", | ||
ondelete="set null", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* Go to *Settings > General Settings* | ||
* Activate the multi-company | ||
* Go to *Settings > User & Companies > Users* | ||
* Select your user to edit it and active the multi-company |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* Olivier Laurent <[email protected]> | ||
* Souheil Bejaoui <[email protected]> | ||
* Andrea Stirpe <[email protected]> | ||
* Alberto Nieto de Pablos <[email protected]> (https://braintec.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module add multi-company management to mail templates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* Go to *Settings* | ||
* Activate the developer mode | ||
* Go to *Settings > Technical > Email > Templates* | ||
* Open a template and set the company field if the template is specific to a | ||
company |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2017 ACSONE SA/NV | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
<record id="mail_template_company_rule" model="ir.rule"> | ||
<field name="name">Mail Template multi-company</field> | ||
<field name="model_id" ref="mail.model_mail_template" /> | ||
<field name="domain_force"> | ||
['|',('company_id','=',False),('company_id','in',company_ids)] | ||
</field> | ||
</record> | ||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.