Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.29
_commit: v1.38
_src_path: gh:oca/oca-addons-repo-template
ci: GitHub
convert_readme_fragments_to_markdown: false
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test-requirements.txt merge=union
1 change: 1 addition & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v4
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ jobs:
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- name: Upload screenshots from JS tests
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: Screenshots of failed JS tests - ${{ matrix.name }}${{ join(matrix.include) }}
path: /tmp/odoo_tests/${{ env.PGDATABASE }}
if-no-files-found: ignore
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repos:
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
rev: d5fab7ee87fceee858a3d01048c78a548974d935
rev: f9b919b9868143135a9c9cb03021089cabba8223
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
Expand Down Expand Up @@ -104,6 +104,7 @@ repos:
additional_dependencies:
- "[email protected]"
- "eslint-plugin-jsdoc@"
- "globals@"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
Expand Down Expand Up @@ -140,7 +141,7 @@ repos:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 3.1.8
rev: 3.3.2
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
Expand Down
36 changes: 15 additions & 21 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,25 @@ disable=all
enable=anomalous-backslash-in-string,
api-one-deprecated,
api-one-multi-together,
assignment-from-none,
attribute-deprecated,
class-camelcase,
dangerous-default-value,
dangerous-view-replace-wo-priority,
development-status-allowed,
duplicate-id-csv,
duplicate-key,
duplicate-xml-fields,
duplicate-xml-record-id,
eval-referenced,
eval-used,
incoherent-interpreter-exec-perm,
openerp-exception-warning,
redundant-modulename-xml,
relative-import,
rst-syntax-error,
wrong-tabs-instead-of-spaces,
xml-syntax-error,
assignment-from-none,
attribute-deprecated,
dangerous-default-value,
development-status-allowed,
duplicate-key,
eval-used,
license-allowed,
manifest-author-string,
manifest-deprecated-key,
Expand All @@ -48,40 +54,28 @@ enable=anomalous-backslash-in-string,
method-inverse,
method-required-super,
method-search,
openerp-exception-warning,
pointless-statement,
pointless-string-statement,
print-used,
redundant-keyword-arg,
redundant-modulename-xml,
reimported,
relative-import,
return-in-init,
rst-syntax-error,
sql-injection,
too-few-format-args,
translation-field,
translation-required,
unreachable,
use-vim-comment,
wrong-tabs-instead-of-spaces,
xml-syntax-error,
missing-manifest-dependency,
too-complex,
# messages that do not cause the lint step to fail
consider-merging-classes-inherited,
create-user-wo-reset-password,
dangerous-filter-wo-user,
deprecated-module,
file-not-used,
invalid-commit,
missing-manifest-dependency,
missing-newline-extrafiles,
missing-readme,
no-utf8-coding-comment,
odoo-addons-relative-import,
old-api7-method-defined,
redefined-builtin,
too-complex,
unnecessary-utf8-coding-comment
manifest-external-assets


[REPORTS]
Expand Down
26 changes: 13 additions & 13 deletions .pylintrc-mandatory
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@ disable=all
enable=anomalous-backslash-in-string,
api-one-deprecated,
api-one-multi-together,
assignment-from-none,
attribute-deprecated,
class-camelcase,
dangerous-default-value,
dangerous-view-replace-wo-priority,
development-status-allowed,
duplicate-id-csv,
duplicate-key,
duplicate-xml-fields,
duplicate-xml-record-id,
eval-referenced,
eval-used,
incoherent-interpreter-exec-perm,
openerp-exception-warning,
redundant-modulename-xml,
relative-import,
rst-syntax-error,
wrong-tabs-instead-of-spaces,
xml-syntax-error,
assignment-from-none,
attribute-deprecated,
dangerous-default-value,
development-status-allowed,
duplicate-key,
eval-used,
license-allowed,
manifest-author-string,
manifest-deprecated-key,
Expand All @@ -40,24 +46,18 @@ enable=anomalous-backslash-in-string,
method-inverse,
method-required-super,
method-search,
openerp-exception-warning,
pointless-statement,
pointless-string-statement,
print-used,
redundant-keyword-arg,
redundant-modulename-xml,
reimported,
relative-import,
return-in-init,
rst-syntax-error,
sql-injection,
too-few-format-args,
translation-field,
translation-required,
unreachable,
use-vim-comment,
wrong-tabs-instead-of-spaces,
xml-syntax-error
use-vim-comment

[REPORTS]
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

[![Support the OCA](https://odoo-community.org/readme-banner-image)](https://odoo-community.org/get-involved?utm_source=repo-readme)

# Social addons for Odoo
[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=14.0)
[![Pre-commit Status](https://github.com/OCA/social/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/OCA/social/actions/workflows/pre-commit.yml?query=branch%3A14.0)
[![Build Status](https://github.com/OCA/social/actions/workflows/test.yml/badge.svg?branch=14.0)](https://github.com/OCA/social/actions/workflows/test.yml?query=branch%3A14.0)
Expand All @@ -7,8 +10,6 @@

<!-- /!\ do not modify above this line -->

# Social addons for Odoo

Addons concerning Odoo's social ERP features and messaging in general.

<!-- /!\ do not modify below this line -->
Expand Down
117 changes: 117 additions & 0 deletions mail_company_aware_sender/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=========================
Mail Sender Company Aware
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7ee2897c3172b5b4d4927dbf7ec1e94e1c71bc5602f7bdf85b3ac0cae33481d0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/14.0/mail_company_aware_sender
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-14-0/social-14-0-mail_company_aware_sender
: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/social&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to send out mails using a company aware email address.
Suppose we have a user Charles the Magnificent with email address
[email protected]. However this user works for two companies, one
for the kingdom of France, with email address [email protected], and
one for the Roman Empire with email address [email protected].

Now when sending out mail, we want to make clear from what active company the
mail is sent, but also want to keep the name of the active user in the
email from address, so when sending from the kingdom, the email from will
be [email protected], but when sending from the empire, the email will
be [email protected].

Note that after installing this module the system parameter mail.default.from
will no longer be used to set the from address.

This module can also be used to send company aware emails from templates.
For instance with this formula for the email_from field:
{{ user.get_company_aware_email(object) }}
In this example the company defined in the object will be used instead of the current
company.

**Table of contents**

.. contents::
:local:

Configuration
=============

To send out mails with company aware from addresses, three things are needed:
* The company partner needs to have an email address;
* The company must be enabled for it's domain being used in from addresses;
* The company email domain must be defined on a domain whitelist in one
or more of the outgoing mail servers.

On the company you can also set whether email from should include the name
of the sender or not. This will only affect emails that are modified to use
the company address.

For particular users/partners there can be an opt-out for using company aware
emails. This can be configured right under the email field in the partner form.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/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 <https://github.com/OCA/social/issues/new?body=module:%20mail_company_aware_sender%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.

Credits
=======

Authors
~~~~~~~

* Therp BV

Contributors
~~~~~~~~~~~~

* `Therp BV <https://therp.nl>`_:

* Ronald Portier (NL66278)

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/social <https://github.com/OCA/social/tree/14.0/mail_company_aware_sender>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions mail_company_aware_sender/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
22 changes: 22 additions & 0 deletions mail_company_aware_sender/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2025 Therp BV <https://therp.nl>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Mail Sender Company Aware",
"summary": "Send emails with company specific mail domain",
"version": "14.0.1.0.0",
"category": "Social Network",
"website": "https://github.com/OCA/social",
"author": ("Therp BV, " "Odoo Community Association (OCA)"),
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"mail",
"mail_outbound_static", # Need the domain whitelist on outgoing server.
],
"data": [
"views/res_company_view.xml",
"views/res_partner_view.xml",
],
}
7 changes: 7 additions & 0 deletions mail_company_aware_sender/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import ir_mail_server
from . import mail_thread
from . import res_company
from . import res_partner
from . import res_users
Loading