Skip to content

Commit

Permalink
[MIG] cmis_mail: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benwillig authored and ThomasBinsfeld committed Aug 13, 2024
1 parent ce3768f commit b314817
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
33 changes: 33 additions & 0 deletions cmis_mail/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=========
Cmis Mail
=========

This module allows to store attachments with CMIS from the mail
composer if the source model has at least one CMIS folder.
When attachments are added on the mail composer, a checkbox allows to
enable the CMIS storage. If the source model has more than one CMIS
folder, it is possible to specify in which one the attachments must be
stored.

Documentation: `alfodoo.org <http://alfodoo.org>`_

Credits
=======

Contributors
------------

* Thomas Binsfeld <[email protected]>

Maintainer
----------

.. image:: https://www.acsone.eu/logo.png
:alt: ACSONE SA/NV
:target: http://www.acsone.eu

This module is maintained by ACSONE SA/NV.
2 changes: 1 addition & 1 deletion cmis_mail/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
folder, it is possible to specify in which one the attachments must be
stored.""",
"category": "Document Management",
"version": "13.0.1.0.0",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV",
"website": "https://alfodoo.org",
Expand Down
10 changes: 6 additions & 4 deletions cmis_mail/wizards/mail_compose_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ def default_get(self, fields): # pylint:disable=redefined-outer-name
related_model = res.get("model")
if not related_model:
return res
cmis_fields = self.env["ir.model.fields"].search(
[("model", "=", related_model), ("ttype", "=", "cmis_folder")]
cmis_fields = (
self.env["ir.model.fields"]
.sudo()
.search([("model", "=", related_model), ("ttype", "=", "cmis_folder")])
)
if cmis_fields:
res.update(
Expand Down Expand Up @@ -154,8 +156,8 @@ def _update_cmis_document(self, buffer, file_name, cmis_doc):
properties=props,
)

def send_mail(self, auto_commit=False):
res = super().send_mail(auto_commit=auto_commit)
def _action_send_mail(self, auto_commit=False):
res = super()._action_send_mail(auto_commit=auto_commit)
for rec in self:
if rec.is_save_in_cmis_enabled:
rec._save_attachments_in_cmis()
Expand Down

0 comments on commit b314817

Please sign in to comment.