Compare commits

...

No commits in common. '14.0' and '12.0' have entirely different histories.
14.0 ... 12.0

  1. 2
      .DINAR/build-date.txt
  2. 4
      .DINAR/config.yaml
  3. 1
      .DINAR/image/dependencies/pip.txt
  4. 27
      .DINAR/image/src/addons.yaml
  5. 1
      .github/FUNDING.yml
  6. 91
      .gitignore
  7. 3
      .isort.cfg
  8. 12
      .pre-commit-config.yaml
  9. 5
      .pylintrc
  10. 4
      .pylintrc-mandatory
  11. 47
      .travis.yml
  12. 23
      LICENSE
  13. 21
      README.md
  14. 29
      mail_all/README.rst
  15. 1
      mail_all/__init__.py
  16. 30
      mail_all/__manifest__.py
  17. 9
      mail_all/doc/changelog.rst
  18. 19
      mail_all/doc/index.rst
  19. 70
      mail_all/i18n/de.po
  20. 69
      mail_all/i18n/es.po
  21. 67
      mail_all/i18n/fr.po
  22. 64
      mail_all/i18n/mail_all.pot
  23. 35
      mail_all/i18n/sl.po
  24. BIN
      mail_all/images/1.jpg
  25. BIN
      mail_all/static/description/1.png
  26. BIN
      mail_all/static/description/2.png
  27. BIN
      mail_all/static/description/icon.png
  28. 84
      mail_all/static/description/index.html
  29. 3
      mail_all/static/src/css/mail_all.css
  30. 50
      mail_all/static/src/js/mail_all.js
  31. 33
      mail_all/static/src/js/test_mail_all.js
  32. 27
      mail_all/static/src/xml/menu.xml
  33. 3
      mail_all/tests/__init__.py
  34. 27
      mail_all/tests/test_js.py
  35. 21
      mail_all/views/templates.xml
  36. 25
      mail_archives/README.rst
  37. 0
      mail_archives/__init__.py
  38. 17
      mail_archives/__manifest__.py
  39. 11
      mail_archives/doc/changelog.rst
  40. 20
      mail_archives/doc/index.rst
  41. 36
      mail_archives/i18n/de.po
  42. 35
      mail_archives/i18n/es.po
  43. 33
      mail_archives/i18n/fr.po
  44. 30
      mail_archives/i18n/mail_archives.pot
  45. 35
      mail_archives/i18n/sl.po
  46. BIN
      mail_archives/images/1.jpg
  47. BIN
      mail_archives/static/description/1.png
  48. BIN
      mail_archives/static/description/2.png
  49. BIN
      mail_archives/static/description/icon.png
  50. 84
      mail_archives/static/description/index.html
  51. 3
      mail_archives/static/src/css/archives.css
  52. 91
      mail_archives/static/src/js/archives.js
  53. 24
      mail_archives/static/src/xml/menu.xml
  54. 1
      mail_archives/tests/__init__.py
  55. 31
      mail_archives/tests/test_js.py
  56. 21
      mail_archives/views/templates.xml
  57. 48
      mail_multi_website/README.rst
  58. 40
      mail_multi_website/__init__.py
  59. 44
      mail_multi_website/__manifest__.py
  60. 9
      mail_multi_website/doc/changelog.rst
  61. 73
      mail_multi_website/doc/index.rst
  62. 123
      mail_multi_website/i18n/mail_multi_website.pot
  63. BIN
      mail_multi_website/images/main.jpg
  64. 7
      mail_multi_website/models/__init__.py
  65. 21
      mail_multi_website/models/ir_property.py
  66. 16
      mail_multi_website/models/mail_message.py
  67. 187
      mail_multi_website/models/mail_template.py
  68. 31
      mail_multi_website/models/mail_thread.py
  69. 47
      mail_multi_website/models/res_users.py
  70. 12
      mail_multi_website/models/website.py
  71. BIN
      mail_multi_website/static/description/icon.png
  72. 96
      mail_multi_website/static/description/index.html
  73. 4
      mail_multi_website/tests/__init__.py
  74. 56
      mail_multi_website/tests/test_fetch.py
  75. 18
      mail_multi_website/tests/test_mail_model.py
  76. 146
      mail_multi_website/tests/test_render.py
  77. 71
      mail_multi_website/tests/test_send.py
  78. 14
      mail_multi_website/views/website_views.xml
  79. 2
      mail_multi_website/wizard/__init__.py
  80. 22
      mail_multi_website/wizard/mail_compose_message.py
  81. 33
      mail_private/README.rst
  82. 3
      mail_private/__init__.py
  83. 39
      mail_private/__manifest__.py
  84. 29
      mail_private/doc/changelog.rst
  85. 26
      mail_private/doc/index.rst
  86. 26
      mail_private/full_composer_wizard.xml
  87. 143
      mail_private/i18n/es.po
  88. 143
      mail_private/i18n/it.po
  89. 138
      mail_private/i18n/mail_private.pot
  90. 143
      mail_private/i18n/pt.po
  91. 143
      mail_private/i18n/pt_BR.po
  92. 140
      mail_private/i18n/ru.po
  93. BIN
      mail_private/images/mail_private_image.png
  94. 100
      mail_private/models.py
  95. BIN
      mail_private/static/description/check_recipients.png
  96. BIN
      mail_private/static/description/icon.png
  97. 118
      mail_private/static/description/index.html
  98. BIN
      mail_private/static/description/result_message.png
  99. 290
      mail_private/static/src/js/mail_private.js
  100. 72
      mail_private/static/src/js/test_private.js

2
.DINAR/build-date.txt

@ -1 +1 @@
new repo readme files
April 3, 2020

4
.DINAR/config.yaml

@ -2,10 +2,6 @@ addons:
# modules to install before running tests
include:
- contacts
# "contacts" already has mail in dependencies,
# but without the following line DINAR may run odoo odoo with --init=mail,....
# which leads to error on loading mail's demo data
- mail
# modules to exclude from installation/testing
exclude:

1
.DINAR/image/dependencies/pip.txt

@ -1,2 +1 @@
# Python dependencies
pycryptodome

27
.DINAR/image/src/addons.yaml

@ -1 +1,28 @@
# see https://github.com/Tecnativa/doodba#optodoocustomsrcaddonsyaml
---
ENV:
DEFAULT_REPO_PATTERN: https://github.com/it-projects-llc/{}.git
web:
- "*"
---
ENV:
DEFAULT_REPO_PATTERN: https://github.com/it-projects-llc/{}.git
access-addons:
- "*"
---
ENV:
DEFAULT_REPO_PATTERN: https://github.com/it-projects-llc/{}.git
misc-addons:
- "*"
---
ENV:
DEFAULT_REPO_PATTERN: https://github.com/it-projects-llc/{}.git
website-addons:
- "*"

1
.github/FUNDING.yml

@ -1,2 +1 @@
ko_fi: itprojectsllc # This is supposed to bring some coffee for us
patreon: itpp # become our patron

91
.gitignore

@ -0,0 +1,91 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
*.pyc
*~
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject

3
.isort.cfg

@ -9,5 +9,4 @@ line_length=88
known_odoo=odoo
known_odoo_addons=odoo.addons
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
default_section=THIRDPARTY
known_third_party=
known_third_party=requests,werkzeug

12
.pre-commit-config.yaml

@ -12,7 +12,6 @@ exclude: |
(LICENSE.*|COPYING.*)
default_language_version:
python: python3
node: "14.13.0"
repos:
- repo: https://github.com/myint/autoflake
rev: v1.4
@ -78,17 +77,6 @@ repos:
rev: v1.26.2
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/acsone/setuptools-odoo
rev: 2.6.0
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
args:
- --output
- requirements.txt
- --header
- "# generated from manifests external_dependencies"
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.8.3
hooks:

5
.pylintrc

@ -8,7 +8,7 @@ manifest_required_authors=IT Projects Labs
manifest_required_keys=license
manifest_deprecated_keys=description,active
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1
valid_odoo_versions=14.0
valid_odoo_versions=12.0
[MESSAGES CONTROL]
disable=all
@ -21,7 +21,7 @@ disable=all
# config as a blocking check.
enable=anomalous-backslash-in-string,
api-one-deprecated,
#api-one-deprecated,
api-one-multi-together,
assignment-from-none,
attribute-deprecated,
@ -45,6 +45,7 @@ enable=anomalous-backslash-in-string,
method-inverse,
method-required-super,
method-search,
missing-import-error,
missing-manifest-dependency,
openerp-exception-warning,
pointless-statement,

4
.pylintrc-mandatory

@ -8,13 +8,13 @@ manifest_required_authors=IT Projects Labs
manifest_required_keys=license
manifest_deprecated_keys=description,active
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1
valid_odoo_versions=14.0
valid_odoo_versions=12.0
[MESSAGES CONTROL]
disable=all
enable=anomalous-backslash-in-string,
api-one-deprecated,
#api-one-deprecated,
api-one-multi-together,
assignment-from-none,
attribute-deprecated,

47
.travis.yml

@ -0,0 +1,47 @@
language: python
python:
- "3.5"
#dist: trusty
sudo: false
cache: pip
addons:
# odoo 12.0+ uses command "INSERT ... ON CONFLICT ...", which is available in 9.5+ only
postgresql: "9.5"
apt:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
env:
global:
- VERSION="12.0" TESTS="0" LINT_CHECK="0" UNIT_TEST="0"
- PYLINT_ODOO_JSLINTRC="/home/travis/maintainer-quality-tools/travis/cfg/.jslintrc"
matrix:
- LINT_CHECK="1"
- CHECK_TAGS="1"
- TESTS="1" ODOO_REPO="odoo/odoo" MAKEPOT="1"
- TESTS="1" ODOO_REPO="OCA/OCB"
install:
- pip install anybox.testing.openerp
- git clone https://github.com/it-projects-llc/maintainer-quality-tools.git
${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly
script:
- travis_run_tests
after_success:
- travis_after_tests_success
notifications:
email: false
webhooks:
on_failure: change
urls:
- "https://ci.it-projects.info/travis/on_failure/change"

23
LICENSE

@ -0,0 +1,23 @@
The MIT License (MIT)
Copyright 2020 IT-Projects Labs
Copyright 2015-2020 IT-Projects LLC
Copyright 2014-2015 Ivan Yelizariev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

21
README.md

@ -1,9 +1,14 @@
[![help@itpp.dev](https://itpp.dev/images/infinity-readme.png)](mailto:help@itpp.dev)
# [14.0] Odoo Mail Addons
# [12.0] Odoo Mail Addons
:open_file_folder: Get a **.zip** file with all needed dependencies:
:heavy_check_mark: [mail_all](https://apps.odoo.com/apps/modules/12.0/mail_all/)
<br/>:heavy_check_mark: [mail_archives](https://apps.odoo.com/apps/modules/12.0/mail_archives/)
<br/>:heavy_check_mark: [mail_multi_website](https://apps.odoo.com/apps/modules/12.0/mail_multi_website/)
<br/>:heavy_check_mark: [mail_private](https://apps.odoo.com/apps/modules/12.0/mail_private/)
<br/>:heavy_check_mark: [mail_sent](https://apps.odoo.com/apps/modules/12.0/mail_sent/)
<br/>:heavy_check_mark: [mail_to](https://apps.odoo.com/apps/modules/12.0/mail_to/)
:star: Star this repo if you **like** it!
@ -14,9 +19,9 @@ Other Addons
| Repository | Versions |
|------------|----------|
| [itpp-labs/**pos-addons**](https://github.com/itpp-labs/pos-addons) | [[14.0]](https://github.com/itpp-labs/pos-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/pos-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/pos-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/pos-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/pos-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/pos-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/pos-addons/tree/8.0#readme) [[7.0]](https://github.com/itpp-labs/pos-addons/tree/7.0#readme) |
| [itpp-labs/**mail-addons**](https://github.com/itpp-labs/mail-addons) | [[14.0]](https://github.com/itpp-labs/mail-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/mail-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/mail-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/mail-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/mail-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/mail-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/mail-addons/tree/8.0#readme) |
| [itpp-labs/**misc-addons**](https://github.com/itpp-labs/misc-addons) | [[14.0]](https://github.com/itpp-labs/misc-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/misc-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/misc-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/misc-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/misc-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/misc-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/misc-addons/tree/8.0#readme) [[7.0]](https://github.com/itpp-labs/misc-addons/tree/7.0#readme) |
| [itpp-labs/**sync-addons**](https://github.com/itpp-labs/sync-addons) | [[14.0]](https://github.com/itpp-labs/sync-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/sync-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/sync-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/sync-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/sync-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/sync-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/sync-addons/tree/8.0#readme) |
| [itpp-labs/**access-addons**](https://github.com/itpp-labs/access-addons) | [[14.0]](https://github.com/itpp-labs/access-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/access-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/access-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/access-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/access-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/access-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/access-addons/tree/8.0#readme) |
| [itpp-labs/**website-addons**](https://github.com/itpp-labs/website-addons) | [[14.0]](https://github.com/itpp-labs/website-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/website-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/website-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/website-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/website-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/website-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/website-addons/tree/8.0#readme) |
| [itpp-labs/**pos-addons**](https://github.com/itpp-labs/pos-addons) | [[15.0]](https://github.com/itpp-labs/pos-addons/tree/15.0#readme) [[14.0]](https://github.com/itpp-labs/pos-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/pos-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/pos-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/pos-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/pos-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/pos-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/pos-addons/tree/8.0#readme) [[7.0]](https://github.com/itpp-labs/pos-addons/tree/7.0#readme) |
| [itpp-labs/**mail-addons**](https://github.com/itpp-labs/mail-addons) | [[15.0]](https://github.com/itpp-labs/mail-addons/tree/15.0#readme) [[14.0]](https://github.com/itpp-labs/mail-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/mail-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/mail-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/mail-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/mail-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/mail-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/mail-addons/tree/8.0#readme) |
| [itpp-labs/**misc-addons**](https://github.com/itpp-labs/misc-addons) | [[15.0]](https://github.com/itpp-labs/misc-addons/tree/15.0#readme) [[14.0]](https://github.com/itpp-labs/misc-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/misc-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/misc-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/misc-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/misc-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/misc-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/misc-addons/tree/8.0#readme) [[7.0]](https://github.com/itpp-labs/misc-addons/tree/7.0#readme) |
| [itpp-labs/**sync-addons**](https://github.com/itpp-labs/sync-addons) | [[15.0]](https://github.com/itpp-labs/sync-addons/tree/15.0#readme) [[14.0]](https://github.com/itpp-labs/sync-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/sync-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/sync-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/sync-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/sync-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/sync-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/sync-addons/tree/8.0#readme) |
| [itpp-labs/**access-addons**](https://github.com/itpp-labs/access-addons) | [[15.0]](https://github.com/itpp-labs/access-addons/tree/15.0#readme) [[14.0]](https://github.com/itpp-labs/access-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/access-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/access-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/access-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/access-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/access-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/access-addons/tree/8.0#readme) |
| [itpp-labs/**website-addons**](https://github.com/itpp-labs/website-addons) | [[15.0]](https://github.com/itpp-labs/website-addons/tree/15.0#readme) [[14.0]](https://github.com/itpp-labs/website-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/website-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/website-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/website-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/website-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/website-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/website-addons/tree/8.0#readme) |

29
mail_all/README.rst

@ -0,0 +1,29 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://opensource.org/licenses/MIT
:alt: License: MIT
===================
Show all messages
===================
Adds ``Discuss / All`` menu, that shows all messages accessible by current user.
Questions?
==========
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev
Contributors
============
* Pavel Romanchenko <apps@it-projects.info>
===================
Odoo Apps Store: https://apps.odoo.com/apps/modules/12.0/mail_all/
Tested on `Odoo 11.0 <https://github.com/odoo/odoo/commit/69c0e6be96563187c09c3748daa61347f7e29360>`_

1
mail_all/__init__.py

@ -0,0 +1 @@
# License MIT (https://opensource.org/licenses/MIT).

30
mail_all/__manifest__.py

@ -0,0 +1,30 @@
# Copyright 2016-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2017-2018 Artyom Losev <https://it-projects.info/team/ArtyomLosev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT).
{
"name": "Show all messages",
"summary": """Checkout all messages where you have access""",
"category": "Discuss",
# "live_test_url": "",
"images": ["images/1.jpg"],
"version": "12.0.1.0.1",
"application": False,
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@itpp.dev",
"website": "https://itpp.dev",
"license": "Other OSI approved licence", # MIT
"price": 40.00,
"currency": "EUR",
"depends": ["mail"],
"external_dependencies": {"python": [], "bin": []},
"data": ["views/templates.xml"],
"qweb": ["static/src/xml/menu.xml"],
"demo": [],
"post_load": None,
"pre_init_hook": None,
"post_init_hook": None,
"uninstall_hook": None,
"installable": True,
"auto_install": False,
}

9
mail_all/doc/changelog.rst

@ -0,0 +1,9 @@
`1.0.1`
-------
- **Fix:** Incorrect counter
`1.0.0`
-------
- Init version

19
mail_all/doc/index.rst

@ -0,0 +1,19 @@
===================
Show all messages
===================
Installation
============
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
Configuration
=============
This module does not require special configuration.
Usage
=====
* Open menu ``Discuss / All messages``
* You see all messages

70
mail_all/i18n/de.po

@ -0,0 +1,70 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_all
#
# Translators:
# Dawid Runowski <dawrun@outlook.com>, 2019
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-05 23:09+0000\n"
"PO-Revision-Date: 2018-04-21 00:05+0000\n"
"Last-Translator: Dawid Runowski <dawrun@outlook.com>, 2019\n"
"Language-Team: German (https://www.transifex.com/it-projects-llc/teams/76080/"
"de/)\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"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/mail_all.js:23
#, fuzzy, python-format
msgid "All Messages"
msgstr "Alle Nachrichten"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:10
#, python-format
msgid "All messages"
msgstr "Alle Nachrichten"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:23
#, python-format
msgid "Check that All Messages are opened"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:17
#, python-format
msgid "Click to enter menu discuss"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:13
#, python-format
msgid "Click to open app list"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:20
#, python-format
msgid "No messages"
msgstr "Keine Nachrichten"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:20
#, fuzzy, python-format
msgid "Open All Messages"
msgstr "Alle Nachrichten"

69
mail_all/i18n/es.po

@ -0,0 +1,69 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_all
#
# Translators:
# Randall Castro <rcastro@treintaycinco.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-21 23:07+0000\n"
"PO-Revision-Date: 2018-04-21 23:07+0000\n"
"Last-Translator: Randall Castro <rcastro@treintaycinco.com>, 2018\n"
"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/"
"teams/76080/es/)\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"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/mail_all.js:23
#, fuzzy, python-format
msgid "All Messages"
msgstr "Todos los mensajes"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:10
#, python-format
msgid "All messages"
msgstr "Todos los mensajes"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:23
#, python-format
msgid "Check that All Messages are opened"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:17
#, python-format
msgid "Click to enter menu discuss"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:13
#, python-format
msgid "Click to open app list"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:20
#, python-format
msgid "No messages"
msgstr "Sin mensajes"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:20
#, fuzzy, python-format
msgid "Open All Messages"
msgstr "Todos los mensajes"

67
mail_all/i18n/fr.po

@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_all
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-30 09:30+0000\n"
"PO-Revision-Date: 2021-12-30 10:33+0100\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: fr\n"
"X-Generator: Poedit 2.4.3\n"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/mail_all.js:24
#, python-format
msgid "All Messages"
msgstr "Tous les messages"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:15
#, python-format
msgid "All messages"
msgstr "Tous les messages"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:26
#, python-format
msgid "Check that All Messages are opened"
msgstr "Vérifie que « Tous les messages » est ouvert"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:18
#, python-format
msgid "Click to enter menu discuss"
msgstr "Cliquer pour entrer dans le menu discuter"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:13
#, python-format
msgid "Click to open app list"
msgstr "Cliquer pour ouvrir la liste des applications"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:23
#, python-format
msgid "No messages"
msgstr "Pas de messages"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:22
#, python-format
msgid "Open All Messages"
msgstr "Ouvrir « Tous les messages »"

64
mail_all/i18n/mail_all.pot

@ -0,0 +1,64 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_all
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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_all
#. openerp-web
#: code:addons/mail_all/static/src/js/mail_all.js:25
#, python-format
msgid "All Messages"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:15
#, python-format
msgid "All messages"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:26
#, python-format
msgid "Check that All Messages are opened"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:18
#, python-format
msgid "Click to enter menu discuss"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:13
#, python-format
msgid "Click to open app list"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:23
#, python-format
msgid "No messages"
msgstr ""
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/test_mail_all.js:22
#, python-format
msgid "Open All Messages"
msgstr ""

35
mail_all/i18n/sl.po

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_all
#
# Translators:
# Matjaz Mozetic <m.mozetic@matmoz.si>, 2019
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-05 23:09+0000\n"
"PO-Revision-Date: 2018-04-21 00:05+0000\n"
"Last-Translator: Matjaz Mozetic <m.mozetic@matmoz.si>, 2019\n"
"Language-Team: Slovenian (https://www.transifex.com/it-projects-llc/teams/76080/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/js/mail_all.js:49
#: code:addons/mail_all/static/src/xml/menu.xml:7
#, python-format
msgid "All messages"
msgstr "Vsa sporočila"
#. module: mail_all
#. openerp-web
#: code:addons/mail_all/static/src/xml/menu.xml:15
#, python-format
msgid "No messages"
msgstr "Ni sporočil"

BIN
mail_all/images/1.jpg

After

Width: 334  |  Height: 171  |  Size: 11 KiB

BIN
mail_all/static/description/1.png

After

Width: 300  |  Height: 270  |  Size: 15 KiB

BIN
mail_all/static/description/2.png

After

Width: 765  |  Height: 400  |  Size: 22 KiB

BIN
mail_all/static/description/icon.png

After

Width: 100  |  Height: 100  |  Size: 2.1 KiB

84
mail_all/static/description/index.html

@ -0,0 +1,84 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Show all messages</h2>
<h3 class="oe_slogan">Checkout all messages where you have access</h3>
</div>
<div class="oe_span6">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="1.png"/>
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
The module adds usual menu.
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p class="oe_mt32">
This menu shows all messages.
</p>
</div>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="2.png"/>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:apps@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:apps@it-projects.info">apps@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
<div class="oe_span4">
<div class="stamp" style="width:200px;">
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(6deg);
-o-transform: rotate(6deg);
-moz-transform: rotate(6deg);
-ms-transform: rotate(6deg);">
Tested on Odoo<br/>12.0 community
</div>
<!--<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);">
Tested on Odoo<br/>12.0 enterprise
</div>-->
</div>
</div>
</div>
</section>

3
mail_all/static/src/css/mail_all.css

@ -0,0 +1,3 @@
.o_channel_name.mail_all i {
margin-right: 4px;
}

50
mail_all/static/src/js/mail_all.js

@ -0,0 +1,50 @@
/* # Copyright 2016-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2017-2018 Artyom Losev <https://it-projects.info/team/ArtyomLosev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT). */
odoo.define("mail_all.all", function(require) {
"use strict";
var core = require("web.core");
var Manager = require("mail.Manager");
var Mailbox = require("mail.model.Mailbox");
var _t = core._t;
Manager.include({
_updateMailboxesFromServer: function(data) {
this._super(data);
if (
!_.find(this.getThreads(), function(th) {
return th.getID() === "mailbox_channel_all";
})
) {
this._addMailbox({
id: "channel_all",
name: _t("All Messages"),
mailboxCounter: 0,
});
}
},
_makeMessage: function(data) {
var message = this._super(data);
message._addThread("mailbox_channel_all");
return message;
},
});
Mailbox.include({
_getThreadDomain: function() {
if (this._id === "mailbox_channel_all") {
return [];
}
return this._super();
},
});
return {
Manager: Manager,
Mailbox: Mailbox,
};
});

33
mail_all/static/src/js/test_mail_all.js

@ -0,0 +1,33 @@
/* # Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT). */
odoo.define("mail_all.tour", function(require) {
"use strict";
var tour = require("web_tour.tour");
var core = require("web.core");
var _t = core._t;
var steps = [
{
trigger: 'a.full[href="#"]',
content: _t("Click to open app list"),
position: "bottom",
},
{
trigger: 'a.dropdown-item.o_app:contains("Discuss")',
content: _t("Click to enter menu discuss"),
position: "bottom",
},
{
content: _t("Open All Messages"),
trigger: ".o_channel_name.mail_all",
},
{
content: _t("Check that All Messages are opened"),
trigger:
".o_mail_discuss_title_main.o_mail_mailbox_title_all.o_mail_discuss_item.o_active",
},
];
tour.register("tour_mail_all", {test: true, url: "/web"}, steps);
});

27
mail_all/static/src/xml/menu.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--# Copyright 2018 Artyom Losev <https://it-projects.info/team/ArtyomLosev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT). -->
<template>
<!--Inherit Sidebar and add All messages menu item after Starred -->
<t t-extend="mail.discuss.Sidebar">
<t t-jquery="div[data-thread-id=mailbox_starred]" t-operation="after">
<div
t-attf-class="o_mail_discuss_title_main o_mail_mailbox_title_all o_mail_discuss_item #{(activeThreadID == 'channel_all') ? 'o_active': ''}"
data-thread-id="mailbox_channel_all"
>
<span class="o_channel_name mail_all"> <i
class="fa fa-database"
/> All messages </span>
</div>
</t>
</t>
<!--Add message about empty all messages page-->
<t t-extend="mail.widget.Thread.Empty">
<t t-jquery="t:last" t-operation="after">
<t t-if="thread.getID() === 'mailbox_channel_all'">
<div class="o_thread_title">No messages</div>
</t>
</t>
</t>
</template>

3
mail_all/tests/__init__.py

@ -0,0 +1,3 @@
# License MIT (https://opensource.org/licenses/MIT).
from . import test_js

27
mail_all/tests/test_js.py

@ -0,0 +1,27 @@
# Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2016 manawi <https://it-projects.info/team/manawi>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT).
import odoo.tests
@odoo.tests.common.at_install(True)
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_01_mail_all(self):
# needed because tests are run before the module is marked as
# installed. In js web will only load qweb coming from modules
# that are returned by the backend in module_boot. Without
# this you end up with js, css but no qweb.
self.env["ir.module.module"].search(
[("name", "=", "mail_all")], limit=1
).state = "installed"
link = "/web#action=%s" % self.ref("mail.action_discuss")
self.phantom_js(
link,
"odoo.__DEBUG__.services['web_tour.tour'].run('tour_mail_all', 1000)",
"odoo.__DEBUG__.services['web_tour.tour'].tours.tour_mail_all.ready",
login="admin",
)

21
mail_all/views/templates.xml

@ -0,0 +1,21 @@
<?xml version="1.0" ?>
<!--# Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Artyom Losev <https://it-projects.info/team/ArtyomLosev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT). -->
<odoo>
<template
id="mail_all_assets_backend"
name="mail_all_assets_backend"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_all/static/src/css/mail_all.css" />
<script src="/mail_all/static/src/js/mail_all.js" type="text/javascript" />
<script
src="/mail_all/static/src/js/test_mail_all.js"
type="text/javascript"
/>
</xpath>
</template>
</odoo>

25
mail_archives/README.rst

@ -0,0 +1,25 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
===============
Mail Archives
===============
Adds Archive menu, which shows sent/received messages
Questions?
==========
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev
Contributors
============
* Pavel Romanchenko <apps@it-projects.info>
===================
Odoo Apps Store: https://apps.odoo.com/apps/modules/12.0/mail_archives/
Tested on `Odoo 12.0 <https://github.com/odoo/odoo/commit/c423e5fe047a66517a60b68874e18dc5c3697787>`_

0
mail_archives/__init__.py

17
mail_archives/__manifest__.py

@ -0,0 +1,17 @@
{
"name": "Mail archives",
"summary": """Adds menu to find old messages""",
"category": "Discuss",
"images": ["images/1.jpg"],
"version": "12.0.1.0.1",
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@itpp.dev",
"website": "https://itpp.dev",
"license": "Other OSI approved licence", # MIT
"price": 40.00,
"currency": "EUR",
"depends": ["mail"],
"data": ["views/templates.xml"],
"qweb": ["static/src/xml/menu.xml"],
"installable": True,
}

11
mail_archives/doc/changelog.rst

@ -0,0 +1,11 @@
`1.0.1`
-------
- **Fix:** Mails from channels were not downloaded automatically
- **Fix:** Fetching mails from another threads
- **Fix:** Incorrect counter
`1.0.0`
-------
- Init version

20
mail_archives/doc/index.rst

@ -0,0 +1,20 @@
==============
Mail Archives
==============
Installation
============
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
Configuration
=============
This module does not require special configuration.
Usage
=====
* Open ``Discuss``.
* Click ``Archive``.
* Sent/received messages are displayed.

36
mail_archives/i18n/de.po

@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_archives
#
# Translators:
# Dawid Runowski <dawrun@outlook.com>, 2019
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-05 23:09+0000\n"
"PO-Revision-Date: 2018-04-21 00:05+0000\n"
"Last-Translator: Dawid Runowski <dawrun@outlook.com>, 2019\n"
"Language-Team: German (https://www.transifex.com/it-projects-llc/teams/76080/"
"de/)\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"
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/js/archives.js:20
#: code:addons/mail_archives/static/src/xml/menu.xml:8
#, python-format
msgid "Archive"
msgstr "Archiv"
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/xml/menu.xml:18
#, python-format
msgid "Archive is empty"
msgstr "Archiv ist leer"

35
mail_archives/i18n/es.po

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_archives
#
# Translators:
# Randall Castro <rcastro@treintaycinco.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-21 23:07+0000\n"
"PO-Revision-Date: 2018-04-21 23:07+0000\n"
"Last-Translator: Randall Castro <rcastro@treintaycinco.com>, 2018\n"
"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/"
"teams/76080/es/)\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"
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/js/archives.js:20
#: code:addons/mail_archives/static/src/xml/menu.xml:8
#, python-format
msgid "Archive"
msgstr "Archivo"
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/xml/menu.xml:18
#, python-format
msgid "Archive is empty"
msgstr "Archivo está vacío"

33
mail_archives/i18n/fr.po

@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_archives
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-30 09:30+0000\n"
"PO-Revision-Date: 2021-12-30 10:33+0100\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: fr\n"
"X-Generator: Poedit 2.4.3\n"
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/js/archives.js:22
#: code:addons/mail_archives/static/src/xml/menu.xml:12
#, python-format
msgid "Archive"
msgstr "Archives"
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/xml/menu.xml:20
#, python-format
msgid "Archive is empty"
msgstr "Les archives sont vides"

30
mail_archives/i18n/mail_archives.pot

@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_archives
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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_archives
#. openerp-web
#: code:addons/mail_archives/static/src/js/archives.js:23
#: code:addons/mail_archives/static/src/xml/menu.xml:12
#, python-format
msgid "Archive"
msgstr ""
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/xml/menu.xml:20
#, python-format
msgid "Archive is empty"
msgstr ""

35
mail_archives/i18n/sl.po

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_archives
#
# Translators:
# Matjaz Mozetic <m.mozetic@matmoz.si>, 2019
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-05 23:09+0000\n"
"PO-Revision-Date: 2018-04-21 00:05+0000\n"
"Last-Translator: Matjaz Mozetic <m.mozetic@matmoz.si>, 2019\n"
"Language-Team: Slovenian (https://www.transifex.com/it-projects-llc/teams/76080/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/js/archives.js:68
#: code:addons/mail_archives/static/src/xml/menu.xml:7
#, python-format
msgid "Archive"
msgstr "Arhiv"
#. module: mail_archives
#. openerp-web
#: code:addons/mail_archives/static/src/xml/menu.xml:15
#, python-format
msgid "Archive is empty"
msgstr "Arhiv je prazen"

BIN
mail_archives/images/1.jpg

After

Width: 334  |  Height: 171  |  Size: 18 KiB

BIN
mail_archives/static/description/1.png

After

Width: 300  |  Height: 270  |  Size: 24 KiB

BIN
mail_archives/static/description/2.png

After

Width: 765  |  Height: 400  |  Size: 40 KiB

BIN
mail_archives/static/description/icon.png

After

Width: 100  |  Height: 100  |  Size: 2.1 KiB

84
mail_archives/static/description/index.html

@ -0,0 +1,84 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Look up old mails</h2>
<h3 class="oe_slogan">Browse archived mails like in odoo 8</h3>
</div>
<div class="oe_span6">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="1.png"/>
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
The module adds usual menu.
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p class="oe_mt32">
This menu shows archive messages, i.e. ones you sent or received.
</p>
</div>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="2.png"/>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:apps@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:apps@it-projects.info">apps@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
<div class="oe_span4">
<div class="stamp" style="width:200px;">
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(6deg);
-o-transform: rotate(6deg);
-moz-transform: rotate(6deg);
-ms-transform: rotate(6deg);">
Tested on Odoo<br/>12.0 community
</div>
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(-7deg);
-o-transform: rotate(-7deg);
-moz-transform: rotate(-7deg);
-ms-transform: rotate(-7deg);">
Tested on Odoo<br/>12.0 enterprise
</div>
</div>
</div>
</div>
</section>

3
mail_archives/static/src/css/archives.css

@ -0,0 +1,3 @@
.o_channel_name.mail_archives i {
margin-right: 4px;
}

91
mail_archives/static/src/js/archives.js

@ -0,0 +1,91 @@
odoo.define("mail_archives.archives", function(require) {
"use strict";
var core = require("web.core");
var session = require("web.session");
var Manager = require("mail.Manager");
var Mailbox = require("mail.model.Mailbox");
var SearchableThread = require("mail.model.SearchableThread");
var _t = core._t;
Manager.include({
_updateMailboxesFromServer: function(data) {
this._super(data);
if (
!_.find(this.getThreads(), function(th) {
return th.getID() === "mailbox_channel_archive";
})
) {
this._addMailbox({
id: "channel_archive",
name: _t("Archive"),
mailboxCounter: 0,
});
}
},
});
SearchableThread.include({
_fetchMessages: function(pDomain, loadMore) {
var self = this;
if (this._id !== "mailbox_channel_archive") {
return this._super(pDomain, loadMore);
}
// This is a copy-paste from super method
var domain = this._getThreadDomain();
var cache = this._getCache(pDomain);
if (pDomain) {
domain = domain.concat(pDomain || []);
}
if (loadMore) {
var minMessageID = cache.messages[0].getID();
domain = [["id", "<", minMessageID]].concat(domain);
}
return this._rpc({
model: "mail.message",
method: "message_fetch",
args: [domain],
kwargs: this._getFetchMessagesKwargs(),
}).then(function(messages) {
// Except this function. It adds the required thread to downloaded messages
_.each(messages, function(m) {
m.channel_ids.push("mailbox_channel_archive");
});
if (!cache.allHistoryLoaded) {
cache.allHistoryLoaded = messages.length < self._FETCH_LIMIT;
}
cache.loaded = true;
_.each(messages, function(message) {
self.call("mail_service", "addMessage", message, {
silent: true,
domain: pDomain,
});
});
cache = self._getCache(pDomain || []);
return cache.messages;
});
},
});
Mailbox.include({
_getThreadDomain: function() {
if (this._id === "mailbox_channel_archive") {
return [
"|",
"|",
["partner_ids", "in", [session.partner_id]],
["author_id", "in", [session.partner_id]],
["channel_ids.channel_partner_ids", "in", [session.partner_id]],
];
}
return this._super();
},
});
return {
Manager: Manager,
Mailbox: Mailbox,
};
});

24
mail_archives/static/src/xml/menu.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<template>
<!--Inherit Sidebar and add Archive menu item after Starred -->
<t t-extend="mail.discuss.Sidebar">
<t t-jquery="div[data-thread-id=mailbox_starred]" t-operation="after">
<div
t-attf-class="o_mail_discuss_title_main o_mail_discuss_item #{(activeThreadID == 'channel_archive') ? 'o_active': ''}"
data-thread-id="mailbox_channel_archive"
>
<span class="o_channel_name mail_archives"> <i
class="fa fa-archive"
/> Archive </span>
</div>
</t>
</t>
<!--Add message about empty archive page-->
<t t-extend="mail.widget.Thread.Empty">
<t t-jquery="t:last" t-operation="after">
<t t-if="thread.getID() === 'mailbox_channel_archive'">
<div class="o_thread_title">Archive is empty</div>
</t>
</t>
</t>
</template>

1
mail_archives/tests/__init__.py

@ -0,0 +1 @@
from . import test_js

31
mail_archives/tests/test_js.py

@ -0,0 +1,31 @@
from werkzeug import url_encode
import odoo.tests
@odoo.tests.common.at_install(True)
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_01_mail_archives(self):
# needed because tests are run before the module is marked as
# installed. In js web will only load qweb coming from modules
# that are returned by the backend in module_boot. Without
# this you end up with js, css but no qweb.
self.env["ir.module.module"].search(
[("name", "=", "mail_archives")], limit=1
).state = "installed"
# wait till page loaded and then click and wait again
code = """
setTimeout(function () {
console.log($(".mail_archives").length && 'ok' || 'error');
}, 3000);
"""
link = "/web#%s" % url_encode({"action": "mail.action_discuss"})
self.phantom_js(
link,
code,
"odoo.__DEBUG__.services['web_tour.tour'].tours.mail_tour.ready",
login="admin",
)

21
mail_archives/views/templates.xml

@ -0,0 +1,21 @@
<?xml version="1.0" ?>
<openerp>
<data>
<template
id="res_partner_mails_count_assets_backend"
name="res_partner_mails_count_assets_backend"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<link
rel="stylesheet"
href="/mail_archives/static/src/css/archives.css"
/>
<script
src="/mail_archives/static/src/js/archives.js"
type="text/javascript"
/>
</xpath>
</template>
</data>
</openerp>

48
mail_multi_website/README.rst

@ -0,0 +1,48 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://opensource.org/licenses/MIT
:alt: License: MIT
=====================
Multi-Brand Mailing
=====================
Mail-related stuff for multi-website support
* Makes following field in ``res.users`` website-dependent:
* ``email``
* ``signature``
* Makes following fields in ``mail.template`` website-dependent:
* ``body_html``
* ``mail_server_id``
* ``report_template``
* Overrides ``mail.template``'s ``render_template`` method to add ``website``
variable. It may cause incompatibility with other modules that redefine that
method too.
Questions?
==========
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev
Contributors
============
* `Ivan Yelizariev <https://it-projects.info/team/yelizariev>`__
Further information
===================
Odoo Apps Store: https://apps.odoo.com/apps/modules/12.0/mail_multi_website/
Notifications on updates: `via Atom <https://github.com/it-projects-llc/mail-addons/commits/12.0/mail_multi_website.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/mail-addons/commits/12.0/mail_multi_website.atom>`_
Tested on `Odoo 12.0 <https://github.com/odoo/odoo/commit/80cef9e8c52ff7dc0715a7478a2288d3de7065df>`_

40
mail_multi_website/__init__.py

@ -0,0 +1,40 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
from . import models
from . import wizard
from .tests import test_mail_model
def post_init_hook(cr, registry):
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})
env.cr.execute("ALTER TABLE res_users ADD COLUMN email_multi_website VARCHAR")
# fill new email column with values from partner
for user in env["res.users"].with_context(active_test=False).search([]):
email = user.partner_id.email
if email:
user._force_default("email_multi_website", email)
def uninstall_hook(cr, registry):
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})
# remove properties
field_ids = [
env.ref("base.field_res_users__email").id,
env.ref("base.field_res_users__signature").id,
env.ref("mail.field_mail_template__body_html").id,
env.ref("mail.field_mail_template__mail_server_id").id,
env.ref("mail.field_mail_template__report_template").id,
]
env["ir.property"].search([("fields_id", "in", field_ids)]).unlink()
# copy emails from partner to user
cr.execute("SELECT partner_id,email_multi_website FROM res_users")
for partner_id, default_email in cr.fetchall():
env["res.partner"].browse(partner_id).email = default_email

44
mail_multi_website/__manifest__.py

@ -0,0 +1,44 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT).
{
"name": """Multi-Brand Mailing""",
"summary": """Use single Backend to manage several Websites""",
"category": "Discuss",
# "live_test_url": "http://apps.it-projects.info/shop/product/website-multi-company?version=11.0",
"images": ["images/main.jpg"],
"version": "12.0.1.0.1",
"application": False,
"author": "IT-Projects LLC, Ivan Yelizariev",
"support": "apps@itpp.dev",
"website": "https://twitter.com/OdooFree",
"license": "Other OSI approved licence", # MIT
"price": 230.00,
"currency": "EUR",
"depends": [
"ir_config_parameter_multi_company",
"web_website",
"mail",
"test_mail",
],
"external_dependencies": {"python": [], "bin": []},
"data": ["views/website_views.xml"],
"demo": [],
"qweb": [],
"post_load": None,
"pre_init_hook": None,
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
"auto_install": False,
"installable": True,
# "demo_title": "Email Addresses per Website",
# "demo_addons": [
# ],
# "demo_addons_hidden": [
# ],
# "demo_url": "DEMO-URL",
# "demo_summary": "Use single Backend to manage several Websites",
# "demo_images": [
# "images/MAIN_IMAGE",
# ]
}

9
mail_multi_website/doc/changelog.rst

@ -0,0 +1,9 @@
`1.0.1`
-------
- **Fix:** Issue with module uninstallation
`1.0.0`
-------
- **Init version**

73
mail_multi_website/doc/index.rst

@ -0,0 +1,73 @@
=====================
Multi-Brand Mailing
=====================
Installation
============
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
Configuration
=============
Access to websites
------------------
* Go to menu ``[[ Settings ]] >> Users & Companies >> Users``
* Select a user
* Grant access ``[x] Multi Websites for Backend``
* Configure **Allowed Websites**
User's email per website
------------------------
* Refresh page if you just granted your user access to websites
* Use top right-hand corner button with current website name to switch between websites
* Use top right-hand corner button with user name and avatar to open
Preference popup. When you edit **Email** field, it will be saved as a value
for current website.
Email template per website
--------------------------
* Refresh page if you just granted your user access to websites
* `Activate Developer Mode <https://odoo-development.readthedocs.io/en/latest/odoo/usage/debug-mode.html>`__
* Use top right-hand corner button with current website name to switch between websites
* Go to menu ``[[ Settings ]] >> Technical >> Email >> Templates``
* When you edit template, following fields will be saved as a value for current website:
* **Body**
* **Outgoing Mail Server**
* **Optional report to print and attach**
* Additional variable ``website`` is available to configure rest fields (**Subject**, **From**, etc.)
Note. If related record (e.g. ``sale.order``) has field ``company_id`` or ``website_id`` those values will be used instead of currently selected in Website / Company Switchers
Alias domain per website
------------------------
Configure ``mail.catchall.domain`` per website. See Documentation of the module `Context-dependent values in System Parameters <https://apps.odoo.com/apps/modules/10.0/ir_config_parameter_multi_company>`__.
Outgoing mails servers per website
--------------------------
If each domain has different Outgoing Mail Server you need following adjustments
* Got to menu ``[[ Website ]] >> Configuration >> Websites``
* In each Website specify field **Outgoing Mails**
Properties
----------
To review properties by website use menu ``[[ Settings ]] >> Technical >> Parameters >> Company Properties``. See **How it works** in Documentation of module `Website Switcher in Backend <https://apps.odoo.com/apps/modules/10.0/web_website>`__.
Usage
=====
When you work from backend, Email for current website is used.
When a user do something on website (e.g. purchase products) and some mail is sent, then email address for that website will be used (mostly Administrator's email address).
When email is sent, template's value like body, subject, etc. for current values are used.

123
mail_multi_website/i18n/mail_multi_website.pot

@ -0,0 +1,123 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_multi_website
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_email_template_preview__body_html
#: model:ir.model.fields,field_description:mail_multi_website.field_mail_template__body_html
msgid "Body"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_mail_test_simple__company_id
msgid "Company"
msgstr ""
#. module: mail_multi_website
#: model:ir.model,name:mail_multi_website.model_ir_property
msgid "Company Property"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,help:mail_multi_website.field_website__mail_server_id
msgid "Default outgoing mail server"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_res_users__email_multi_website
msgid "Email Multi Website"
msgstr ""
#. module: mail_multi_website
#: model:ir.model,name:mail_multi_website.model_mail_template
msgid "Email Templates"
msgstr ""
#. module: mail_multi_website
#: model:ir.model,name:mail_multi_website.model_mail_thread
msgid "Email Thread"
msgstr ""
#. module: mail_multi_website
#: model:ir.model,name:mail_multi_website.model_mail_compose_message
msgid "Email composition wizard"
msgstr ""
#. module: mail_multi_website
#: code:addons/mail_multi_website/models/mail_template.py:147
#, python-format
msgid "Failed to render template %r using values %r"
msgstr ""
#. module: mail_multi_website
#: model:ir.model,name:mail_multi_website.model_mail_message
msgid "Message"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_res_users__email
msgid "Multi Website Email"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,help:mail_multi_website.field_email_template_preview__mail_server_id
#: model:ir.model.fields,help:mail_multi_website.field_mail_template__mail_server_id
msgid "Optional preferred server for outgoing mails. If not set, the highest priority one will be used."
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_email_template_preview__report_template
#: model:ir.model.fields,field_description:mail_multi_website.field_mail_template__report_template
msgid "Optional report to print and attach (Multi-Website)"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_email_template_preview__mail_server_id
#: model:ir.model.fields,field_description:mail_multi_website.field_mail_template__mail_server_id
msgid "Outgoing Mail Server (Multi-Website)"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_website__mail_server_id
msgid "Outgoing Mails"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_mail_compose_message__mail_server_id
#: model:ir.model.fields,field_description:mail_multi_website.field_mail_mail__mail_server_id
#: model:ir.model.fields,field_description:mail_multi_website.field_mail_message__mail_server_id
msgid "Outgoing mail server"
msgstr ""
#. module: mail_multi_website
#: model:ir.model.fields,field_description:mail_multi_website.field_res_users__signature
msgid "Signature"
msgstr ""
#. module: mail_multi_website
#: model:ir.model,name:mail_multi_website.model_mail_test_simple
msgid "Simple Chatter Model"
msgstr ""
#. module: mail_multi_website
#: model:ir.model,name:mail_multi_website.model_res_users
msgid "Users"
msgstr ""
#. module: mail_multi_website
#: model:ir.model,name:mail_multi_website.model_website
#: model:ir.model.fields,field_description:mail_multi_website.field_mail_test_simple__website_id
msgid "Website"
msgstr ""

BIN
mail_multi_website/images/main.jpg

After

Width: 750  |  Height: 371  |  Size: 285 KiB

7
mail_multi_website/models/__init__.py

@ -0,0 +1,7 @@
# License MIT (https://opensource.org/licenses/MIT).
from . import res_users
from . import ir_property
from . import mail_template
from . import mail_thread
from . import mail_message
from . import website

21
mail_multi_website/models/ir_property.py

@ -0,0 +1,21 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import api, models
class IrProperty(models.Model):
_inherit = "ir.property"
@api.multi
def write(self, vals):
res = super(IrProperty, self).write(vals)
field_object_list = [
self.env.ref("base.field_res_users__email"),
self.env.ref("mail.field_mail_template__body_html"),
self.env.ref("mail.field_mail_template__mail_server_id"),
self.env.ref("mail.field_mail_template__report_template"),
]
for fobj in field_object_list:
self._update_db_value_website_dependent(fobj)
return res

16
mail_multi_website/models/mail_message.py

@ -0,0 +1,16 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import fields, models
class Message(models.Model):
_inherit = "mail.message"
def _default_mail_server_id(self):
website = self.env.context.get("website_id")
if not website:
return
website = self.env["website"].sudo().browse(website)
return website.mail_server_id.id
mail_server_id = fields.Many2one(default=_default_mail_server_id)

187
mail_multi_website/models/mail_template.py

@ -0,0 +1,187 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
import logging
from odoo import _, api, fields, models, tools
from odoo.exceptions import UserError
from odoo.tools import pycompat
from odoo.addons.mail.models.mail_template import format_amount, format_date, format_tz
_logger = logging.getLogger(__name__)
FIELDS = ["body_html", "mail_server_id", "report_template"]
try:
from odoo.addons.mail.models.mail_template import (
mako_safe_template_env,
mako_template_env,
)
except ImportError:
_logger.warning("jinja2 not available, templating features will not work!")
class MailTemplate(models.Model):
_inherit = ["mail.template", "website_dependent.mixin"]
_name = "mail.template"
body_html = fields.Html(company_dependent=True, website_dependent=True)
mail_server_id = fields.Many2one(
string="Outgoing Mail Server (Multi-Website)",
company_dependent=True,
website_dependent=True,
)
report_template = fields.Many2one(
string="Optional report to print and attach (Multi-Website)",
company_dependent=True,
website_dependent=True,
)
@api.multi
def generate_email(self, res_ids, fields=None):
"""Remove mail_server_id when not set to recompute in _default_mail_server_id in mail.message"""
multi_mode = True
if isinstance(res_ids, pycompat.integer_types):
multi_mode = False
res = super(MailTemplate, self).generate_email(res_ids, fields=fields)
if not multi_mode:
list_of_dict = {0: res}
else:
list_of_dict = res
for _unused, data in list_of_dict.items():
if "mail_server_id" in data and not data.get("mail_server_id"):
del data["mail_server_id"]
return res
@api.model
def _render_template(self, template_txt, model, res_ids, post_process=False):
"""Override to add website to context"""
multi_mode = True
if isinstance(res_ids, pycompat.integer_types):
multi_mode = False
res_ids = [res_ids]
results = dict.fromkeys(res_ids, u"")
# try to load the template
try:
mako_env = (
mako_safe_template_env
if self.env.context.get("safe")
else mako_template_env
)
template = mako_env.from_string(tools.ustr(template_txt))
except Exception:
_logger.info("Failed to load template %r", template_txt, exc_info=True)
return multi_mode and results or results[res_ids[0]]
# prepare template variables
records = self.env[model].browse(
it for it in res_ids if it
) # filter to avoid browsing [None]
res_to_rec = dict.fromkeys(res_ids, None)
for record in records:
res_to_rec[record.id] = record
variables = {
"format_date": lambda date, format=False, context=self._context: format_date(
self.env, date, format
),
"format_tz": lambda dt, tz=False, format=False, context=self._context: format_tz(
self.env, dt, tz, format
),
"format_amount": lambda amount, currency, context=self._context: format_amount(
self.env, amount, currency
),
"user": self.env.user,
"ctx": self._context, # context kw would clash with mako internals
}
# [NEW] Check website and company context
company = self.env["res.company"] # empty value
company_id = self.env.context.get("force_company")
if company_id:
company = self.env["res.company"].sudo().browse(company_id)
if self.env.context.get("website_id"):
website = self.env["website"].browse(self.env.context.get("website_id"))
else:
website = self.env.user.backend_website_id
for res_id, record in res_to_rec.items():
record_company = company
if not record_company:
if hasattr(record, "company_id") and record.company_id:
record_company = record.company_id
record_website = website
if hasattr(record, "website_id") and record.website_id:
record_website = record.website_id
if (
record_company
and record_website
and record_website.company_id != company
):
# company and website are incompatible, so keep only company
record_website = self.env["website"] # empty value
record_context = dict(
force_company=record_company.id, website_id=record_website.id
)
variables["object"] = record.with_context(**record_context)
variables["website"] = record_website
try:
render_result = template.render(variables)
except Exception:
_logger.info(
"Failed to render template %r using values %r"
% (template, variables),
exc_info=True,
)
raise UserError(
_("Failed to render template %r using values %r")
% (template, variables)
)
if render_result == u"False":
render_result = u""
if post_process:
render_result = self.with_context(**record_context).render_post_process(
render_result
)
results[res_id] = render_result
return multi_mode and results or results[res_ids[0]]
@api.model
def create(self, vals):
res = super(MailTemplate, self).create(vals)
# make value company independent
for f in FIELDS:
res._force_default(f, vals.get(f))
return res
@api.multi
def write(self, vals):
res = super(MailTemplate, self).write(vals)
# TODO: will it work with OCA's partner_firstname module?
if "name" in vals:
fields_to_update = FIELDS
else:
fields_to_update = [f for f in FIELDS if f in vals]
for f in fields_to_update:
self._update_properties_label(f)
return res
def _auto_init(self):
for f in FIELDS:
self._auto_init_website_dependent(f)
return super(MailTemplate, self)._auto_init()

31
mail_multi_website/models/mail_thread.py

@ -0,0 +1,31 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import api, models, tools
class MailThread(models.AbstractModel):
_inherit = "mail.thread"
@api.model
def message_route_process(self, message, message_dict, routes):
rcpt_tos = ",".join(
[
tools.decode_message_header(message, "Delivered-To"),
tools.decode_message_header(message, "To"),
tools.decode_message_header(message, "Cc"),
tools.decode_message_header(message, "Resent-To"),
tools.decode_message_header(message, "Resent-Cc"),
]
)
rcpt_tos_websiteparts = [
e.split("@")[1].lower() for e in tools.email_split(rcpt_tos)
]
website = (
self.env["website"].sudo().search([("domain", "in", rcpt_tos_websiteparts)])
)
if website:
self = self.with_context(website_id=website[0].id)
return super(MailThread, self).message_route_process(
message, message_dict, routes
)

47
mail_multi_website/models/res_users.py

@ -0,0 +1,47 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
FIELD_NAME = "email_multi_website"
FIELDS = ["signature"]
ALL_FIELDS = [FIELD_NAME] + FIELDS
class User(models.Model):
_inherit = ["res.users", "website_dependent.mixin"]
_name = "res.users"
signature = fields.Html(company_dependent=True, website_dependent=True)
# extra field to detach email field from res.partner
email = fields.Char(
string="Multi Website Email", related="email_multi_website", inherited=False
)
email_multi_website = fields.Char(company_dependent=True, website_dependent=True)
@api.model
def create(self, vals):
res = super(User, self).create(vals)
# make value company independent
res._force_default(FIELD_NAME, vals.get("email"))
for f in FIELDS:
res._force_default(f, vals.get(f))
return res
@api.multi
def write(self, vals):
res = super(User, self).write(vals)
# TODO: will it work with OCA's partner_firstname module?
if any(k in vals for k in ["name", "email"] + FIELDS):
for f in ALL_FIELDS:
self._update_properties_label(f)
return res
def _auto_init(self):
for f in FIELDS:
self._auto_init_website_dependent(f)
return super(User, self)._auto_init()

12
mail_multi_website/models/website.py

@ -0,0 +1,12 @@
# Copyright 2017 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import fields, models
class Website(models.Model):
_inherit = "website"
mail_server_id = fields.Many2one(
"ir.mail_server", "Outgoing Mails", help="Default outgoing mail server"
)

BIN
mail_multi_website/static/description/icon.png

After

Width: 100  |  Height: 100  |  Size: 2.1 KiB

96
mail_multi_website/static/description/index.html

@ -0,0 +1,96 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan" style="color:#875A7B;">Multi-Brand Mailing</h2>
<h3 class="oe_slogan">Use single Backend to manage several Websites</h3>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="alert alert-info oe_mt32" style="padding:0.3em 0.6em; font-size: 150%;">
<i class="fa fa-hand-o-right"></i><b> Key features: </b>
<ul class="list-unstyled">
<li>
<i class="fa fa-check-square-o text-primary"></i>
Separate Mail Templates per website
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
<em>From</em> address in email has address for current Website
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
<em>Reply-To</em> address in email has domain of current Website
</li>
<li>
<i class="fa fa-check-square-o text-primary"></i>
User's signature per Website
</li>
</ul>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:apps@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:apps@it-projects.info">apps@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
<div class="oe_span4">
<div class="stamp" style="width:200px;">
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(1deg);
-o-transform: rotate(1deg);
-moz-transform: rotate(1deg);
-ms-transform: rotate(1deg);">
Tested on Odoo<br/>11.0 community
</div>
<!--<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(1deg);
-o-transform: rotate(1deg);
-moz-transform: rotate(1deg);
-ms-transform: rotate(1deg);">
Tested on Odoo<br/>11.0 enterprise
</div>-->
</div>
</div>
</div>
</section>

4
mail_multi_website/tests/__init__.py

@ -0,0 +1,4 @@
# License MIT (https://opensource.org/licenses/MIT).
from . import test_send
from . import test_render
from . import test_fetch

56
mail_multi_website/tests/test_fetch.py

@ -0,0 +1,56 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT).
from odoo.tools import mute_logger
from odoo.addons.test_mail.data.test_mail_data import MAIL_TEMPLATE
from odoo.addons.test_mail.tests.test_mail_mail import TestMail
class TestFetch(TestMail):
at_install = True
post_install = True
def setUp(self):
super(TestFetch, self).setUp()
self.website = self.env["website"].create(
{"name": "Test Website", "domain": "example.com"}
)
self.company = self.env["res.company"].create({"name": "New Test Website"})
self.website.company_id = self.company
# copy-paste from mail.tests.test_mail_gateway
mail_test_model = self.env["ir.model"]._get("mail.test.simple")
# groups@.. will cause the creation of new mail.test
self.alias = self.env["mail.alias"].create(
{
"alias_name": "groups",
"alias_user_id": False,
"alias_model_id": mail_test_model.id,
"alias_contact": "everyone",
}
)
@mute_logger("odoo.addons.mail.models.mail_thread", "odoo.models")
def test_fetch_multi_website(self):
""" Incoming email on an alias creating a new record + message_new + message details """
new_groups = self.format_and_process(
MAIL_TEMPLATE, subject="My Frogs", to="groups@example.com, other@gmail.com"
)
# Test: one group created by mailgateway administrator
self.assertEqual(
len(new_groups),
1,
"message_process: a new mail.test should have been created",
)
self.assertEqual(
new_groups.website_id,
self.website,
"New record is created with wrong website",
)
self.assertEqual(
new_groups.company_id,
self.company,
"New record is created with wrong company",
)

18
mail_multi_website/tests/test_mail_model.py

@ -0,0 +1,18 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import fields, models
class MailTest(models.Model):
_inherit = "mail.test.simple"
company_id = fields.Many2one(
"res.company",
default=lambda self: self.env["res.company"]._company_default_get(),
)
website_id = fields.Many2one(
"website",
default=lambda self: self.env["website"].browse(
self.env.context.get("website_id")
),
)

146
mail_multi_website/tests/test_render.py

@ -0,0 +1,146 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License MIT (https://opensource.org/licenses/MIT).
import base64
from odoo.addons.test_mail.tests.test_mail_mail import TestMail
class TestRender(TestMail):
at_install = True
post_install = True
def setUp(self):
super(TestRender, self).setUp()
self.original_email = self.env.user.email
self.original_company = self.env.user.company_id
self.email = "superadmin@second-website.example"
self.assertNotEqual(self.original_email, self.email)
self.website = self.env.ref("website.website2")
self.company = self.env["res.company"].create({"name": "New Test Website"})
self.website.company_id = self.company
self.mail_server_id = self.env["ir.mail_server"].create(
{"name": "mail server", "smtp_host": "mail.example.com"}
)
self.website.mail_server_id = self.mail_server_id
user_admin = self.env.ref("base.user_admin")
# copy-paste from mail.tests.test_mail_template
self._attachments = [
{
"name": "_Test_First",
"datas_fname": "first.txt",
"datas": base64.b64encode(b"My first attachment"),
"res_model": "res.partner",
"res_id": user_admin.partner_id.id,
},
{
"name": "_Test_Second",
"datas_fname": "second.txt",
"datas": base64.b64encode(b"My second attachment"),
"res_model": "res.partner",
"res_id": user_admin.partner_id.id,
},
]
self.partner_1 = self.env["res.partner"].create({"name": "partner_1"})
self.partner_2 = self.env["res.partner"].create({"name": "partner_2"})
self.email_1 = "test1@example.com"
self.email_2 = "test2@example.com"
self.email_3 = self.partner_1.email
self.email_template = self.env["mail.template"].create(
{
"model_id": self.env["ir.model"]._get("mail.test").id,
"name": "Pigs Template",
"subject": "${website.name}",
"body_html": "${object.description}",
"user_signature": False,
"attachment_ids": [
(0, 0, self._attachments[0]),
(0, 0, self._attachments[1]),
],
"partner_to": "%s,%s"
% (self.partner_2.id, self.user_employee.partner_id.id),
"email_to": "{}, {}".format(self.email_1, self.email_2),
"email_cc": "%s" % self.email_3,
}
)
def switch_user_website(self):
# add website to allowed
self.env.user.write(
dict(
backend_website_ids=[(4, self.website.id)],
backend_website_id=self.website.id,
company_id=self.company.id,
company_ids=[(4, self.company.id)],
)
)
def test_website_in_render_variables(self):
"""Mail values are per website"""
self.env.user.backend_website_id = None
TestModel = self.env["mail.test"].with_context(
{"mail_create_nolog": True, "mail_create_nosubscribe": True}
)
self.test_pigs = TestModel.create(
{
"name": "Pigs",
"description": "Fans of Pigs, unite !",
"alias_name": "pigs",
"alias_contact": "followers",
}
)
# sending without website
mail_id = self.email_template.send_mail(self.test_pigs.id)
mail = self.env["mail.mail"].browse(mail_id)
self.assertEqual(mail.subject, "")
self.assertFalse(mail.mail_server_id)
# sending from frontend
self.test_pigs.company_id = None
mail_id = self.email_template.with_context(
wdb=True, website_id=self.website.id
).send_mail(self.test_pigs.id)
mail = self.env["mail.mail"].browse(mail_id)
self.assertEqual(mail.subject, self.website.name)
self.assertEqual(mail.mail_server_id, self.mail_server_id)
# copy-pasted tests
self.assertEqual(mail.email_to, self.email_template.email_to)
# for some reason self.email_template.email_cc might return u'False'
self.assertEqual(
mail.email_cc or "False", self.email_template.email_cc or "False"
)
self.assertEqual(
mail.recipient_ids, self.partner_2 | self.user_employee.partner_id
)
# sending from frontend
self.switch_user_website()
mail_id = self.email_template.send_mail(self.test_pigs.id)
mail = self.env["mail.mail"].browse(mail_id)
self.assertEqual(mail.subject, self.website.name)
def _test_message_post_with_template(self):
# It's deactivated, because workaround is based on checking host value in get_current_website()
"""Simulate sending email on eCommerce checkout"""
self.switch_user_website()
self.env.user.email = self.email
self.env.user.invalidate_cache()
self.env.user.invalidate_cache()
self.assertEqual(self.env.user.email, self.email)
# switch admin user back
self.env.user.company_id = self.original_company
self.env.user.invalidate_cache()
self.assertEqual(self.env.user.email, self.original_email)
self.test_pigs.with_context(
website_id=self.website.id
).message_post_with_template(self.email_template.id)
message = self.env["mail.message"].search([], order="id desc", limit=1)
self.assertIn("<%s>" % self.email, message.email_from)

71
mail_multi_website/tests/test_send.py

@ -0,0 +1,71 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
from odoo.tests.common import TransactionCase
class TestSendMail(TransactionCase):
at_install = True
post_install = True
def setUp(self):
super(TestSendMail, self).setUp()
self.website = self.env.ref("website.website2")
self.company = self.env["res.company"].create({"name": "New Test Website"})
self.original_email = self.env.user.email
self.original_company = self.env.user.company_id
self.email = "superadmin@second-website.example"
# Check that current email is set and differs
self.assertTrue(self.email)
self.assertNotEqual(self.original_email, self.email)
self.website.company_id = self.company
def switch_user_website(self):
# add website to allowed
self.env.user.write(
dict(
backend_website_ids=[(4, self.website.id)],
backend_website_id=self.website.id,
company_id=self.company.id,
company_ids=[(4, self.company.id)],
)
)
def test_multi_email(self):
"""User has email addresses per website"""
self.switch_user_website()
# update user's email
self.env.user.email = self.email
# Check that writing works
self.env.user.invalidate_cache()
self.assertEqual(
self.env.user.email,
self.email,
"Write methods doesn't work (Field is not in registry?)",
)
# changing company will automatically update website value to empty value
self.env.user.company_id = self.original_company
self.env.user.invalidate_cache()
self.assertEqual(
self.env.user.email,
self.original_email,
"Multi-email doesn't work on switching websites",
)
def test_multi_email_partner(self):
"""Partner doesn't have email addresses per website"""
original_email = "original@email1"
new_email = "new@email2"
partner = self.env["res.partner"].create(
{"name": "test", "email": original_email}
)
self.switch_user_website()
# update partner's email
partner.email = new_email
self.assertEqual(partner.email, new_email)
# changing company will automatically update website value to empty value
self.env.user.company_id = self.original_company
self.env.user.invalidate_cache()
self.assertEqual(
partner.email, new_email, "Partner's email must not be Multi-website"
)

14
mail_multi_website/views/website_views.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
License MIT (https://opensource.org/licenses/MIT). -->
<odoo>
<record id="view_website_multi_mail_form" model="ir.ui.view">
<field name="model">website</field>
<field name="inherit_id" ref="website.view_website_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='default_lang_id']" position="after">
<field name="mail_server_id" />
</xpath>
</field>
</record>
</odoo>

2
mail_multi_website/wizard/__init__.py

@ -0,0 +1,2 @@
# License MIT (https://opensource.org/licenses/MIT).
from . import mail_compose_message

22
mail_multi_website/wizard/mail_compose_message.py

@ -0,0 +1,22 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import api, models
from odoo.http import request
class MailComposer(models.TransientModel):
_inherit = "mail.compose.message"
@api.model
def create(self, vals):
"""Workaround for https://github.com/odoo/odoo/pull/26589"""
if "website_id" not in self.env.context:
website = (
request and hasattr(request, "website") and request.website or None
)
if not website:
website = self.env["website"].get_current_website()
if website:
self = self.with_context(website_id=website.id)
return super(MailComposer, self).create(vals)

33
mail_private/README.rst

@ -0,0 +1,33 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://opensource.org/licenses/MIT
:alt: License: MIT
====================
Internal Messaging
====================
Send private messages to specified recipients, regardless of who are in followers list.
Questions?
==========
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev
Contributors
============
* Pavel Romanchenko
Further information
===================
Odoo Apps Store: https://apps.odoo.com/apps/modules/12.0/mail_private/
Notifications on updates: `via Atom <https://github.com/it-projects-llc/mail-addons/commits/12.0/mail_private.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/mail-addons/commits/12.0/mail_private.atom>`_
Tested on `Odoo 12.0 <https://github.com/odoo/odoo/commit/5240bc2303816348837425b88fc7ee3ff7de2336>`_

3
mail_private/__init__.py

@ -0,0 +1,3 @@
# License MIT (https://opensource.org/licenses/MIT).
from . import models

39
mail_private/__manifest__.py

@ -0,0 +1,39 @@
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/>
# License MIT (https://opensource.org/licenses/MIT).
{
"name": """Internal Messaging""",
"summary": """Send private messages to specified recipients, regardless of who are in followers list.""",
"category": "Discuss",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=12.0",
"images": ["images/mail_private_image.png"],
"version": "12.0.1.1.2",
"application": False,
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@itpp.dev",
"website": "https://itpp.dev",
"license": "Other OSI approved licence", # MIT
"price": 50.00,
"currency": "EUR",
"depends": ["mail"],
"external_dependencies": {"python": [], "bin": []},
"data": ["template.xml", "full_composer_wizard.xml"],
"demo": [],
"qweb": ["static/src/xml/mail_private.xml"],
"post_load": None,
"pre_init_hook": None,
"post_init_hook": None,
"uninstall_hook": None,
"auto_install": False,
"installable": True,
# "demo_title": "{MODULE_NAME}",
# "demo_addons": [
# ],
# "demo_addons_hidden": [
# ],
# "demo_url": "DEMO-URL",
# "demo_summary": "{SHORT_DESCRIPTION_OF_THE_MODULE}",
# "demo_images": [
# "images/MAIN_IMAGE",
# ]
}

29
mail_private/doc/changelog.rst

@ -0,0 +1,29 @@
`1.1.2
-------
- **FIX:** Compatibility error with EE modules
`1.1.1`
-------
- **Improvement:** refactoring code
`1.1.0`
-------
- **New**: internal users are flagged automatically.
`1.0.2`
-------
- **FIX:** Error when choosing a message template
`1.0.1`
-------
- **PORT:** Odoo 10 support.
`1.0.0`
-------
- Init version

26
mail_private/doc/index.rst

@ -0,0 +1,26 @@
====================
Internal Messaging
====================
Installation
============
Nothing special is needed to install this module.
Usage
=====
To send a message to specified recipients:
* Click on the ``[Send internal message]``.
* Choose the recipients that should receive a message by ticking the checkboxes.
* To add more recipients click on the ``[Open the full mail composer]`` on the right upper corner of the message block and choose recipients in the **Recipient** field.
* Click on the ``[Send]`` button.
Uninstallation
==============
Nothing special is needed to uninstall this module.

26
mail_private/full_composer_wizard.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--Copyright 2017 Artyom Losev <https://github.com/ArtyomLosev>
Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/>
License MIT (https://opensource.org/licenses/MIT).-->
<odoo>
<record model="ir.ui.view" id="email_compose_message_wizard_form_private">
<field name="name">mail.compose.message.form.private</field>
<field name="model">mail.compose.message</field>
<field name="groups_id" eval="[(4,ref('base.group_user'))]" />
<field name="inherit_id" ref="mail.email_compose_message_wizard_form" />
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='active_domain']" position="after">
<field name="is_private" invisible="1" />
</xpath>
<xpath
expr="//div[@groups='base.group_user']/span[2]"
position="attributes"
>
<attribute name="attrs">{'invisible': [('is_private', '=', True)]}
</attribute>
</xpath>
</data>
</field>
</record>
</odoo>

143
mail_private/i18n/es.po

@ -0,0 +1,143 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_private
#
# Translators:
# Randall Castro <rcastro@treintaycinco.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-19 16:49+0000\n"
"PO-Revision-Date: 2017-12-19 16:49+0000\n"
"Last-Translator: Randall Castro <rcastro@treintaycinco.com>, 2018\n"
"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/"
"teams/76080/es/)\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"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:43
#, python-format
msgid "Check the first one"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:30
#, python-format
msgid "Click on Private mail creating button"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:35
#, python-format
msgid "Dummy action"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Asistente para crear email"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:18
#, python-format
msgid "Go to the list of subscribers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:26
#, python-format
msgid "Go to user page"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_message
msgid "Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:22
#, python-format
msgid "Select a user"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:14
#, python-format
msgid "Select channel settings"
msgstr ""
#. module: mail_private
#: model:ir.model.fields,field_description:mail_private.field_mail_compose_message__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_mail__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_message__is_private
msgid "Send Internal Message"
msgstr "Enviar mensaje interno"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send a message to specified recipients only"
msgstr "Enviar un mensaje sólo a los destinatarios especificados"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:52
#: code:addons/mail_private/static/src/js/test_private.js:55
#, python-format
msgid "Send email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send internal message"
msgstr "Enviar mensaje interno"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:15
#, python-format
msgid "To: Followers of"
msgstr "Para: Seguidores de"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:26
#, python-format
msgid "Uncheck all"
msgstr "Desmarcar todos"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:39
#, fuzzy, python-format
msgid "Uncheck all Followers"
msgstr "Desmarcar todos"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:46
#, python-format
msgid "Write some email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:20
#, python-format
msgid "this document"
msgstr "este documento"

143
mail_private/i18n/it.po

@ -0,0 +1,143 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_private
#
# Translators:
# Translation Bot <i18n-bot@it-projects.info>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-17 20:20+0000\n"
"PO-Revision-Date: 2017-07-17 20:20+0000\n"
"Last-Translator: Translation Bot <i18n-bot@it-projects.info>, 2017\n"
"Language-Team: Italian (https://www.transifex.com/it-projects-llc/"
"teams/76080/it/)\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"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:43
#, python-format
msgid "Check the first one"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:30
#, python-format
msgid "Click on Private mail creating button"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:35
#, python-format
msgid "Dummy action"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Componi Email"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:18
#, python-format
msgid "Go to the list of subscribers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:26
#, python-format
msgid "Go to user page"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_message
msgid "Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:22
#, python-format
msgid "Select a user"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:14
#, python-format
msgid "Select channel settings"
msgstr ""
#. module: mail_private
#: model:ir.model.fields,field_description:mail_private.field_mail_compose_message__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_mail__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_message__is_private
msgid "Send Internal Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send a message to specified recipients only"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:52
#: code:addons/mail_private/static/src/js/test_private.js:55
#, python-format
msgid "Send email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send internal message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:15
#, python-format
msgid "To: Followers of"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:26
#, python-format
msgid "Uncheck all"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:39
#, python-format
msgid "Uncheck all Followers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:46
#, python-format
msgid "Write some email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:20
#, python-format
msgid "this document"
msgstr ""

138
mail_private/i18n/mail_private.pot

@ -0,0 +1,138 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_private
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:52
#, python-format
msgid "Check the first one"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:36
#, python-format
msgid "Click on Private mail creating button"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:42
#, python-format
msgid "Dummy action"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_compose_message
msgid "Email composition wizard"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:21
#, python-format
msgid "Go to the list of subscribers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:31
#, python-format
msgid "Go to user page"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_message
msgid "Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:26
#, python-format
msgid "Select a user"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:16
#, python-format
msgid "Select channel settings"
msgstr ""
#. module: mail_private
#: model:ir.model.fields,field_description:mail_private.field_mail_compose_message__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_mail__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_message__is_private
msgid "Send Internal Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:13
#, python-format
msgid "Send a message to specified recipients only"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:63
#: code:addons/mail_private/static/src/js/test_private.js:67
#, python-format
msgid "Send email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:13
#, python-format
msgid "Send internal message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:19
#, python-format
msgid "To: Followers of"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:33
#, python-format
msgid "Uncheck all"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:47
#, python-format
msgid "Uncheck all Followers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:56
#, python-format
msgid "Write some email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:24
#, python-format
msgid "this document"
msgstr ""

143
mail_private/i18n/pt.po

@ -0,0 +1,143 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_private
#
# Translators:
# Translation Bot <i18n-bot@it-projects.info>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-15 13:31+0000\n"
"PO-Revision-Date: 2017-12-15 13:31+0000\n"
"Last-Translator: Translation Bot <i18n-bot@it-projects.info>, 2017\n"
"Language-Team: Portuguese (https://www.transifex.com/it-projects-llc/"
"teams/76080/pt/)\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"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:43
#, python-format
msgid "Check the first one"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:30
#, python-format
msgid "Click on Private mail creating button"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:35
#, python-format
msgid "Dummy action"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Assistente de composição de Email"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:18
#, python-format
msgid "Go to the list of subscribers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:26
#, python-format
msgid "Go to user page"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_message
msgid "Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:22
#, python-format
msgid "Select a user"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:14
#, python-format
msgid "Select channel settings"
msgstr ""
#. module: mail_private
#: model:ir.model.fields,field_description:mail_private.field_mail_compose_message__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_mail__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_message__is_private
msgid "Send Internal Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send a message to specified recipients only"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:52
#: code:addons/mail_private/static/src/js/test_private.js:55
#, python-format
msgid "Send email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send internal message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:15
#, python-format
msgid "To: Followers of"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:26
#, python-format
msgid "Uncheck all"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:39
#, python-format
msgid "Uncheck all Followers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:46
#, python-format
msgid "Write some email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:20
#, python-format
msgid "this document"
msgstr ""

143
mail_private/i18n/pt_BR.po

@ -0,0 +1,143 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_private
#
# Translators:
# Translation Bot <i18n-bot@it-projects.info>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-15 13:31+0000\n"
"PO-Revision-Date: 2017-12-15 13:31+0000\n"
"Last-Translator: Translation Bot <i18n-bot@it-projects.info>, 2017\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/it-projects-"
"llc/teams/76080/pt_BR/)\n"
"Language: pt_BR\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"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:43
#, python-format
msgid "Check the first one"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:30
#, python-format
msgid "Click on Private mail creating button"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:35
#, python-format
msgid "Dummy action"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Assistente de Composição de Email"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:18
#, python-format
msgid "Go to the list of subscribers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:26
#, python-format
msgid "Go to user page"
msgstr ""
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_message
msgid "Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:22
#, python-format
msgid "Select a user"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:14
#, python-format
msgid "Select channel settings"
msgstr ""
#. module: mail_private
#: model:ir.model.fields,field_description:mail_private.field_mail_compose_message__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_mail__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_message__is_private
msgid "Send Internal Message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send a message to specified recipients only"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:52
#: code:addons/mail_private/static/src/js/test_private.js:55
#, python-format
msgid "Send email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send internal message"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:15
#, python-format
msgid "To: Followers of"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:26
#, python-format
msgid "Uncheck all"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:39
#, python-format
msgid "Uncheck all Followers"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:46
#, python-format
msgid "Write some email"
msgstr ""
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:20
#, python-format
msgid "this document"
msgstr ""

140
mail_private/i18n/ru.po

@ -0,0 +1,140 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_private
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-01-22 15:48+0000\n"
"PO-Revision-Date: 2020-01-22 15:48+0000\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_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:43
#, python-format
msgid "Check the first one"
msgstr "Отметьте галкой первого"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:30
#, python-format
msgid "Click on Private mail creating button"
msgstr "Нажмите на кнопку создания приватного сообщения"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:35
#, python-format
msgid "Dummy action"
msgstr "Пустое действие"
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Мастер составления эл. писем"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:18
#, python-format
msgid "Go to the list of subscribers"
msgstr "Перейдите с списку подписчиков"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:26
#, python-format
msgid "Go to user page"
msgstr "Перейдите на страницу пользователя"
#. module: mail_private
#: model:ir.model,name:mail_private.model_mail_message
msgid "Message"
msgstr "Сообщение"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:22
#, python-format
msgid "Select a user"
msgstr "Выберите пользователя"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:14
#, python-format
msgid "Select channel settings"
msgstr "Выберите настройки канала"
#. module: mail_private
#: model:ir.model.fields,field_description:mail_private.field_mail_compose_message__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_mail__is_private
#: model:ir.model.fields,field_description:mail_private.field_mail_message__is_private
msgid "Send Internal Message"
msgstr "Отправить внутреннее сообщение"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send a message to specified recipients only"
msgstr "Отправьте сообщение только выбранным пользователям"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:52
#: code:addons/mail_private/static/src/js/test_private.js:55
#, python-format
msgid "Send email"
msgstr "Отправить эл.письмо"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:9
#, python-format
msgid "Send internal message"
msgstr "Отправить внутреннее сообщение"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:15
#, python-format
msgid "To: Followers of"
msgstr "Подписчикам"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:26
#, python-format
msgid "Uncheck all"
msgstr "Сбросить отметки"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:39
#, python-format
msgid "Uncheck all Followers"
msgstr "Убрать галки со всех подписчиков"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/js/test_private.js:46
#, python-format
msgid "Write some email"
msgstr "Напишите какое-либо сообщение"
#. module: mail_private
#. openerp-web
#: code:addons/mail_private/static/src/xml/mail_private.xml:20
#, python-format
msgid "this document"
msgstr "этот документ"

BIN
mail_private/images/mail_private_image.png

After

Width: 766  |  Height: 387  |  Size: 33 KiB

100
mail_private/models.py

@ -0,0 +1,100 @@
# Copyright 2016 x620 <https://github.com/x620>
# Copyright 2017 Artyom Losev <https://github.com/ArtyomLosev>
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import api, fields, models
class MailComposeMessage(models.TransientModel):
_inherit = "mail.compose.message"
is_private = fields.Boolean(string="Send Internal Message")
class MailMessage(models.Model):
_inherit = "mail.message"
is_private = fields.Boolean(string="Send Internal Message")
def send_recepients_for_internal_message(self, model, domain):
result = []
default_resource = self.env[model].search(domain)
follower_ids = default_resource.message_follower_ids
recipient_ids = [r.partner_id for r in follower_ids if r.partner_id]
# channel_ids = [c.channel_id for c in follower_ids if c.channel_id]
for recipient in recipient_ids:
result.append(
{
"checked": recipient.user_ids.id
and not any(recipient.user_ids.mapped("share")),
"partner_id": recipient.id,
"full_name": recipient.name,
"name": recipient.name,
"email_address": recipient.email,
"reason": "Recipient",
}
)
# for channel in channel_ids:
# result.append({
# 'checked': True,
# 'channel_id': channel.id,
# 'full_name': channel,
# 'name': '# '+channel.name,
# 'reason': 'Channel',
# })
return result
@api.multi
def _notify(
self,
record,
msg_vals,
force_send=False,
send_after_commit=True,
model_description=False,
mail_auto_delete=True,
):
self_sudo = self.sudo()
msg_vals = msg_vals if msg_vals else {}
if (
"is_private" not in self_sudo._context
or not self_sudo._context["is_private"]
):
return super(MailMessage, self)._notify(
record,
msg_vals,
force_send,
send_after_commit,
model_description,
mail_auto_delete,
)
else:
rdata = self._notify_compute_internal_recipients(record, msg_vals)
return self._notify_recipients(
rdata,
record,
msg_vals,
force_send=force_send,
send_after_commit=send_after_commit,
model_description=model_description,
mail_auto_delete=mail_auto_delete,
)
@api.multi
def _notify_compute_internal_recipients(self, record, msg_vals):
recipient_data = super(MailMessage, self)._notify_compute_recipients(
record, msg_vals
)
pids = (
[x[1] for x in msg_vals.get("partner_ids")]
if "partner_ids" in msg_vals
else self.sudo().partner_ids.ids
)
recipient_data["partners"] = [
i for i in recipient_data["partners"] if i["id"] in pids
]
return recipient_data

BIN
mail_private/static/description/check_recipients.png

After

Width: 1092  |  Height: 692  |  Size: 108 KiB

BIN
mail_private/static/description/icon.png

After

Width: 100  |  Height: 100  |  Size: 2.1 KiB

118
mail_private/static/description/index.html

@ -0,0 +1,118 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Internal Messaging</h2>
<h3 class="oe_slogan">Send private messages to specified recipients, regardless of who are in followers list.</h3>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p class="oe_mt32">
<div class="alert alert-warning" style="padding:0.6em 0.6em; font-size: 120%;">
By default, to send a private message to specific recipient(s) you need to delete other followers included to the same document. The module allows to send private messages to recipients you specified, regardless of who are in the followers list.
</div>
</p>
<div class="alert alert-success" style="padding:0.3em 0.6em; font-size: 120%;">
<ul style="padding-left: 1.2em;">
<li style="margin-top: 0.3em;">
It simplify internal communication in leads, when you need to send some private messages to your colleagues before reply to a customer.
</li>
<li style="margin-top: 0.3em;">
It helps in records like project tasks: in a task with many participants, you can easily send message and only specified colleagues will be notified.
</li>
<li style="margin-top: 0.3em;">
It allows to have clean inbox for everybody. It's very essential, because people often neglect important message in Inbox full of useless messages.
</li>
</ul>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12 text-center">
<h3 class="oe_slogan">How it works</h3>
<p class="oe_mt32">
<font style="font-size: 120%;">
Click <b>Send internal message</b>, choose the recipient(s) and send a message.
</font>
</p>
<div class="oe_screenshot" align="center">
<img style="max-width: 80%" src="check_recipients.png?1"/>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12 text-center">
<p class="oe_mt32">
<font style="font-size: 120%;">
As a result, the message is sent to the corresponding recipient(s). Other followers will not receive the notification.
</font>
</p>
<div class="oe_screenshot" align="center">
<img style="max-width: 80%" src="result_message.png?2"/>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:apps@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:apps@it-projects.info">apps@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
<div class="oe_span4">
<div class="stamp" style="width:200px;">
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(6deg);
-o-transform: rotate(6deg);
-moz-transform: rotate(6deg);
-ms-transform: rotate(6deg);">
Tested on Odoo<br/>11.0 community
</div>
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(-7deg);
-o-transform: rotate(-7deg);
-moz-transform: rotate(-7deg);
-ms-transform: rotate(-7deg);">
Tested on Odoo<br/>11.0 enterprise
</div>
</div>
</div>
</div>
</section>

BIN
mail_private/static/description/result_message.png

After

Width: 1154  |  Height: 838  |  Size: 94 KiB

290
mail_private/static/src/js/mail_private.js

@ -0,0 +1,290 @@
/* Copyright 2016-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
Copyright 2016 manavi <https://github.com/manawi>
Copyright 2017-2018 Artyom Losev <https://github.com/ArtyomLosev>
Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/>
License MIT (https://opensource.org/licenses/MIT). */
odoo.define("mail_private", function(require) {
"use strict";
var Chatter = require("mail.Chatter");
var ChatterComposer = require("mail.composer.Chatter");
var session = require("web.session");
var rpc = require("web.rpc");
var mailUtils = require("mail.utils");
Chatter.include({
init: function() {
this._super.apply(this, arguments);
this.private = false;
this.events["click .oe_compose_post_private"] =
"on_open_composer_private_message";
},
on_open_composer_private_message: function(event) {
var self = this;
this.fetch_recipients_for_internal_message().then(function(data) {
self._openComposer({
is_private: true,
suggested_partners: data,
});
});
},
_openComposer: function(options) {
var self = this;
var old_composer = this._composer;
// Create the new composer
this._composer = new ChatterComposer(
this,
this.record.model,
options.suggested_partners || [],
{
commandsEnabled: false,
context: this.context,
inputMinHeight: 50,
isLog: options && options.isLog,
recordName: this.recordName,
defaultBody:
old_composer &&
old_composer.$input &&
old_composer.$input.val(),
defaultMentionSelections:
old_composer && old_composer.getMentionListenerSelections(),
attachmentIds:
(old_composer && old_composer.get("attachment_ids")) || [],
is_private: options.is_private,
}
);
this._composer.on("input_focused", this, function() {
this._composer.mentionSetPrefetchedPartners(
this._mentionSuggestions || []
);
});
this._composer.insertAfter(this.$(".o_chatter_topbar")).then(function() {
// Destroy existing composer
if (old_composer) {
old_composer.destroy();
}
self._composer.focus();
self._composer.on("post_message", self, function(messageData) {
if (options.is_private) {
self._composer.options.isLog = true;
}
self._discardOnReload(messageData).then(function() {
self._disableComposer();
self.fields.thread
.postMessage(messageData)
.then(function() {
self._closeComposer(true);
if (self._reloadAfterPost(messageData)) {
self.trigger_up("reload");
} else if (messageData.attachment_ids.length) {
self._reloadAttachmentBox();
self.trigger_up("reload", {
fieldNames: ["message_attachment_count"],
keepChanges: true,
});
}
})
.fail(function() {
self._enableComposer();
});
});
});
var toggle_post_private = self._composer.options.is_private || false;
self._composer.on(
"need_refresh",
self,
self.trigger_up.bind(self, "reload")
);
self._composer.on(
"close_composer",
null,
self._closeComposer.bind(self, true)
);
self.$el.addClass("o_chatter_composer_active");
self.$(
".o_chatter_button_new_message, .o_chatter_button_log_note, .oe_compose_post_private"
).removeClass("o_active");
self.$(".o_chatter_button_new_message").toggleClass(
"o_active",
!self._composer.options.isLog && !self._composer.options.is_private
);
self.$(".o_chatter_button_log_note").toggleClass(
"o_active",
self._composer.options.isLog && !options.is_private
);
self.$(".oe_compose_post_private").toggleClass(
"o_active",
toggle_post_private
);
});
},
fetch_recipients_for_internal_message: function() {
var self = this;
self.result = {};
var follower_ids_domain = [["id", "=", self.context.default_res_id]];
return rpc
.query({
model: "mail.message",
method: "send_recepients_for_internal_message",
args: [[], self.context.default_model, follower_ids_domain],
})
.then(function(res) {
return _.filter(res, function(obj) {
return obj.partner_id !== session.partner_id;
});
});
},
});
ChatterComposer.include({
init: function(parent, model, suggestedPartners, options) {
this._super(parent, model, suggestedPartners, options);
this.events["click .oe_composer_uncheck"] = "on_uncheck_recipients";
if (typeof options.is_private === "undefined") {
// Otherwise it causes an error in context creating function
options.is_private = false;
}
},
_preprocessMessage: function() {
var self = this;
var def = $.Deferred();
this._super().then(function(message) {
message = _.extend(message, {
subtype: "mail.mt_comment",
message_type: "comment",
context: _.defaults({}, self.context, session.user_context),
});
// Subtype
if (self.options.isLog) {
message.subtype = "mail.mt_note";
}
if (self.options.is_private) {
message.context.is_private = true;
message.channel_ids = self.get_checked_channel_ids();
}
// Partner_ids
if (self.options.isLog) {
def.resolve(message);
} else {
var check_suggested_partners = self._getCheckedSuggestedPartners();
self._checkSuggestedPartners(check_suggested_partners).done(
function(partnerIDs) {
message.partner_ids = (message.partner_ids || []).concat(
partnerIDs
);
// Update context
message.context = _.defaults({}, message.context, {
mail_post_autofollow: true,
});
def.resolve(message);
}
);
}
});
return def;
},
on_uncheck_recipients: function() {
this.$(".o_composer_suggested_partners input:checked").each(function() {
$(this).prop("checked", false);
});
},
_onOpenFullComposer: function() {
if (!this._doCheckAttachmentUpload()) {
return false;
}
var self = this;
var recipientDoneDef = $.Deferred();
this.trigger_up("discard_record_changes", {
proceed: function() {
if (self.options.isLog) {
recipientDoneDef.resolve([]);
} else {
var checkedSuggestedPartners = self._getCheckedSuggestedPartners();
self._checkSuggestedPartners(checkedSuggestedPartners).then(
recipientDoneDef.resolve.bind(recipientDoneDef)
);
}
},
});
recipientDoneDef.then(function(partnerIDs) {
var context = {
default_parent_id: self.id,
default_body: mailUtils.getTextToHTML(self.$input.val()),
default_attachment_ids: _.pluck(self.get("attachment_ids"), "id"),
default_partner_ids: partnerIDs,
default_is_log: self.options.isLog,
mail_post_autofollow: true,
is_private: self.options.is_private,
};
if (self.options && self.options.is_private) {
context.default_is_private = self.options.is_private;
}
if (self.context.default_model && self.context.default_res_id) {
context.default_model = self.context.default_model;
context.default_res_id = self.context.default_res_id;
}
var action = {
type: "ir.actions.act_window",
res_model: "mail.compose.message",
view_mode: "form",
view_type: "form",
views: [[false, "form"]],
target: "new",
context: context,
};
self.do_action(action, {
on_close: self.trigger.bind(self, "need_refresh"),
}).then(self.trigger.bind(self, "close_composer"));
});
},
_getCheckedSuggestedPartners: function() {
var checked_partners = this._super(this, arguments);
// Workaround: odoo code works only when all partners are checked intially,
// while may select only some of them (internal recepients)
_.each(checked_partners, function(partner) {
partner.checked = true;
});
checked_partners = _.uniq(
_.filter(checked_partners, function(obj) {
return obj.reason !== "Channel";
})
);
this.get_checked_channel_ids();
return checked_partners;
},
get_checked_channel_ids: function() {
var self = this;
var checked_channels = [];
this.$(".o_composer_suggested_partners input:checked").each(function() {
var full_name = $(this).data("fullname");
checked_channels = checked_channels.concat(
_.filter(self.suggested_partners, function(item) {
return full_name === item.full_name;
})
);
});
checked_channels = _.uniq(
_.filter(checked_channels, function(obj) {
return obj.reason === "Channel";
})
);
return _.pluck(checked_channels, "channel_id");
},
});
});

72
mail_private/static/src/js/test_private.js

@ -0,0 +1,72 @@
/* Copyright 2018-2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/>
License MIT (https://opensource.org/licenses/MIT).*/
odoo.define("mail_private.tour", function(require) {
"use strict";
var core = require("web.core");
var tour = require("web_tour.tour");
var _t = core._t;
var email = "mail_private test email";
var steps = [
tour.STEPS.SHOW_APPS_MENU_ITEM,
{
trigger: ".fa.fa-cog.o_mail_channel_settings",
content: _t("Select channel settings"),
position: "bottom",
},
{
trigger: '.nav-link:contains("Members")',
content: _t("Go to the list of subscribers"),
position: "bottom",
},
{
trigger: '.o_data_cell:contains("YourCompany, Marc Demo")',
content: _t("Select a user"),
position: "bottom",
},
{
trigger: '.o_form_uri.o_field_widget:contains("YourCompany, Marc Demo")',
content: _t("Go to user page"),
position: "bottom",
},
{
trigger: "button.oe_compose_post_private",
content: _t("Click on Private mail creating button"),
position: "bottom",
},
{
// For some reason (due to tricky renderings) button.oe_composer_uncheck could not be find by the tour manager
trigger: ".o_control_panel.o_breadcrumb_full li.active",
content: _t("Dummy action"),
},
{
trigger: "button.oe_composer_uncheck",
extra_trigger: "button.oe_composer_uncheck",
content: _t("Uncheck all Followers"),
timeout: 10000,
},
{
trigger: "div.o_composer_suggested_partners",
content: _t("Check the first one"),
},
{
trigger: "textarea.o_composer_text_field:first",
content: _t("Write some email"),
run: function() {
$("textarea.o_composer_text_field:first").val(email);
},
},
{
trigger: ".o_composer_send .o_composer_button_send",
content: _t("Send email"),
},
{
trigger: ".o_mail_thread .o_thread_message:contains(" + email + ")",
content: _t("Send email"),
},
];
tour.register("mail_private_tour", {test: true, url: "/web"}, steps);
});

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save