diff --git a/mail_attach_existing_attachment/README.rst b/mail_attach_existing_attachment/README.rst new file mode 100644 index 00000000..8fef7a5a --- /dev/null +++ b/mail_attach_existing_attachment/README.rst @@ -0,0 +1,115 @@ +=============================== +Mail Attach Existing Attachment +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:06897e29cf4f22512f7b26e538e7883ef789bd3f99a6c2666c3f6fce2ac51427 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github + :target: https://github.com/OCA/mail/tree/18.0/mail_attach_existing_attachment + :alt: OCA/mail +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_attach_existing_attachment + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module was written to add the possibility to add attachments +located on the object by sending it by email with the mail compose +message wizard + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +- Add some attachments on an object by creating a new *Log note* + +|image1| + +- Then, by sending the object via email, you can select the attachment + added earlier + +|image2| + +.. |image1| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_attach_existing_attachment/static/description/attachment.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/mail/18.0/mail_attach_existing_attachment/static/description/ex_mail_compose_message.png + +Known issues / Roadmap +====================== + +- The module only allows the addition of attachments linked to the + object. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ACSONE SA/NV +* Tecnativa + +Contributors +------------ + +- Adrien Peiffer +- Benoit Aimont +- `Tecnativa `__: + + - Sergio Teruel + - Ernesto Tejeda + +- `360ERP `__: + + - Andrea Stirpe + +- `Apik `__: + + - Frederic Grall + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/mail `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_attach_existing_attachment/__init__.py b/mail_attach_existing_attachment/__init__.py new file mode 100644 index 00000000..40272379 --- /dev/null +++ b/mail_attach_existing_attachment/__init__.py @@ -0,0 +1 @@ +from . import wizard diff --git a/mail_attach_existing_attachment/__manifest__.py b/mail_attach_existing_attachment/__manifest__.py new file mode 100644 index 00000000..6b35495b --- /dev/null +++ b/mail_attach_existing_attachment/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2015 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Mail Attach Existing Attachment", + "summary": "Adding attachment on the object by sending this one", + "author": "ACSONE SA/NV, Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/mail", + "category": "Social Network", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "depends": ["mail"], + "data": ["wizard/mail_compose_message_view.xml"], + "installable": True, +} diff --git a/mail_attach_existing_attachment/i18n/ca.po b/mail_attach_existing_attachment/i18n/ca.po new file mode 100644 index 00000000..12950978 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/ca.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: social (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-13 02:44+0000\n" +"PO-Revision-Date: 2016-06-12 23:57+0000\n" +"Last-Translator: <>\n" +"Language-Team: Catalan (http://www.transifex.com/oca/OCA-social-9-0/language/" +"ca/)\n" +"Language: ca\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_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistent per composició de correus electrònics" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +msgid "Object Attachments" +msgstr "" diff --git a/mail_attach_existing_attachment/i18n/de.po b/mail_attach_existing_attachment/i18n/de.po new file mode 100644 index 00000000..62cd915b --- /dev/null +++ b/mail_attach_existing_attachment/i18n/de.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +# OCA Transbot , 2016 +# Niki Waibel , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-29 14:24+0000\n" +"PO-Revision-Date: 2016-11-29 14:24+0000\n" +"Last-Translator: Niki Waibel , 2016\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/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_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "Kann Anhang anhängen" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistent zum Email verfassen" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +#, fuzzy +msgid "Object Attachments" +msgstr "Anhänge" diff --git a/mail_attach_existing_attachment/i18n/es.po b/mail_attach_existing_attachment/i18n/es.po new file mode 100644 index 00000000..23b9543f --- /dev/null +++ b/mail_attach_existing_attachment/i18n/es.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +# OCA Transbot , 2017 +# Pedro M. Baeza , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-01 02:19+0000\n" +"PO-Revision-Date: 2023-09-03 13:36+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/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" +"X-Generator: Weblate 4.17\n" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "Puede adjuntar adjuntos" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Asistente composición Correo Electrónico" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +msgid "Object Attachments" +msgstr "Archivos adjuntos de objetos" diff --git a/mail_attach_existing_attachment/i18n/es_CO.po b/mail_attach_existing_attachment/i18n/es_CO.po new file mode 100644 index 00000000..fb5bd09b --- /dev/null +++ b/mail_attach_existing_attachment/i18n/es_CO.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: social (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-13 02:44+0000\n" +"PO-Revision-Date: 2016-06-12 23:57+0000\n" +"Last-Translator: <>\n" +"Language-Team: Spanish (Colombia) (http://www.transifex.com/oca/OCA-" +"social-9-0/language/es_CO/)\n" +"Language: es_CO\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_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Asistente de redacción de E-mail" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +msgid "Object Attachments" +msgstr "" diff --git a/mail_attach_existing_attachment/i18n/fr.po b/mail_attach_existing_attachment/i18n/fr.po new file mode 100644 index 00000000..428f66df --- /dev/null +++ b/mail_attach_existing_attachment/i18n/fr.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +# OCA Transbot , 2016 +# Quentin THEURET , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-22 09:45+0000\n" +"PO-Revision-Date: 2017-07-22 09:45+0000\n" +"Last-Translator: Quentin THEURET , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "Il est possible d'attacher des pièces jointes" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistant de composition de courriel" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +#, fuzzy +msgid "Object Attachments" +msgstr "Pièces jointes" diff --git a/mail_attach_existing_attachment/i18n/he.po b/mail_attach_existing_attachment/i18n/he.po new file mode 100644 index 00000000..d3c265b6 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/he.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-10-19 08:08+0000\n" +"Last-Translator: Yves Goldberg \n" +"Language-Team: none\n" +"Language: he\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n == 1) ? 0 : ((n == 2) ? 1 : ((n > 10 && " +"n % 10 == 0) ? 2 : 3));\n" +"X-Generator: Weblate 3.10\n" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "ניתן לצרף קובץ מצורף" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "אשף יצירת דואר אלקטרוני" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +msgid "Object Attachments" +msgstr "קבצים מצורפים לאובייקט" diff --git a/mail_attach_existing_attachment/i18n/hr.po b/mail_attach_existing_attachment/i18n/hr.po new file mode 100644 index 00000000..b07a723e --- /dev/null +++ b/mail_attach_existing_attachment/i18n/hr.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +# Bole , 2016 +msgid "" +msgstr "" +"Project-Id-Version: social (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-13 02:44+0000\n" +"PO-Revision-Date: 2016-06-14 11:29+0000\n" +"Last-Translator: Bole \n" +"Language-Team: Croatian (http://www.transifex.com/oca/OCA-social-9-0/" +"language/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "Može pridružiti privitak" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Čarobnjak za sastavljanje maila" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +#, fuzzy +msgid "Object Attachments" +msgstr "Privitci" diff --git a/mail_attach_existing_attachment/i18n/it.po b/mail_attach_existing_attachment/i18n/it.po new file mode 100644 index 00000000..95ca26ca --- /dev/null +++ b/mail_attach_existing_attachment/i18n/it.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +# OCA Transbot , 2016 +# Marius Marolla , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-17 01:02+0000\n" +"PO-Revision-Date: 2024-11-12 20:06+0000\n" +"Last-Translator: mymage \n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/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" +"X-Generator: Weblate 5.6.2\n" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "Può inserire allegati" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "Visualizza allegato oggetto" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Procedura guidata creazione e-mail" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +msgid "Object Attachments" +msgstr "Allegati oggetto" diff --git a/mail_attach_existing_attachment/i18n/mail_attach_existing_attachment.pot b/mail_attach_existing_attachment/i18n/mail_attach_existing_attachment.pot new file mode 100644 index 00000000..13f148ab --- /dev/null +++ b/mail_attach_existing_attachment/i18n/mail_attach_existing_attachment.pot @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +msgid "Object Attachments" +msgstr "" diff --git a/mail_attach_existing_attachment/i18n/pt_BR.po b/mail_attach_existing_attachment/i18n/pt_BR.po new file mode 100644 index 00000000..497ae45c --- /dev/null +++ b/mail_attach_existing_attachment/i18n/pt_BR.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +# Armando Vulcano Junior , 2015 +msgid "" +msgstr "" +"Project-Id-Version: social (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-13 02:44+0000\n" +"PO-Revision-Date: 2019-08-26 16:01+0000\n" +"Last-Translator: Rodrigo Macedo \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-" +"social-9-0/language/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" +"X-Generator: Weblate 3.8\n" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "Pode Anexar Anexo" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistente de Composição de Email" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +msgid "Object Attachments" +msgstr "Anexos de Objeto" diff --git a/mail_attach_existing_attachment/i18n/sl.po b/mail_attach_existing_attachment/i18n/sl.po new file mode 100644 index 00000000..038e5539 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/sl.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: social (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-13 02:44+0000\n" +"PO-Revision-Date: 2020-03-19 10:13+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-social-9-0/" +"language/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 3.10\n" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "Lahko pripenja priponke" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Čarovnik za sestavljanje e-pošte" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +msgid "Object Attachments" +msgstr "Priponke objekta" diff --git a/mail_attach_existing_attachment/i18n/zh_CN.po b/mail_attach_existing_attachment/i18n/zh_CN.po new file mode 100644 index 00000000..14f9c018 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/zh_CN.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +# Translators: +# Jeffery Chenn , 2016 +msgid "" +msgstr "" +"Project-Id-Version: social (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-02 00:46+0000\n" +"PO-Revision-Date: 2016-09-04 05:54+0000\n" +"Last-Translator: Jeffery Chenn \n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-social-9-0/" +"language/zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__can_attach_attachment +msgid "Can Attach Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__display_object_attachment_ids +msgid "Display Object Attachment" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message__object_attachment_ids +#, fuzzy +msgid "Object Attachments" +msgstr "附件" diff --git a/mail_attach_existing_attachment/pyproject.toml b/mail_attach_existing_attachment/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/mail_attach_existing_attachment/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mail_attach_existing_attachment/readme/CONTRIBUTORS.md b/mail_attach_existing_attachment/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..74bed8a7 --- /dev/null +++ b/mail_attach_existing_attachment/readme/CONTRIBUTORS.md @@ -0,0 +1,9 @@ +- Adrien Peiffer \<\> +- Benoit Aimont \<\> +- [Tecnativa](https://www.tecnativa.com): + - Sergio Teruel + - Ernesto Tejeda +- [360ERP](https://www.360erp.com): + - Andrea Stirpe +- [Apik](https://www.aapik.cloud): + - Frederic Grall diff --git a/mail_attach_existing_attachment/readme/DESCRIPTION.md b/mail_attach_existing_attachment/readme/DESCRIPTION.md new file mode 100644 index 00000000..8f21687e --- /dev/null +++ b/mail_attach_existing_attachment/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module was written to add the possibility to add attachments +located on the object by sending it by email with the mail compose +message wizard diff --git a/mail_attach_existing_attachment/readme/ROADMAP.md b/mail_attach_existing_attachment/readme/ROADMAP.md new file mode 100644 index 00000000..7182847c --- /dev/null +++ b/mail_attach_existing_attachment/readme/ROADMAP.md @@ -0,0 +1,2 @@ +- The module only allows the addition of attachments linked to the + object. diff --git a/mail_attach_existing_attachment/readme/USAGE.md b/mail_attach_existing_attachment/readme/USAGE.md new file mode 100644 index 00000000..b1bdedd9 --- /dev/null +++ b/mail_attach_existing_attachment/readme/USAGE.md @@ -0,0 +1,10 @@ +To use this module, you need to: + +- Add some attachments on an object by creating a new *Log note* + +![](../static/description/attachment.png) + +- Then, by sending the object via email, you can select the attachment + added earlier + +![](../static/description/ex_mail_compose_message.png) diff --git a/mail_attach_existing_attachment/static/description/attachment.png b/mail_attach_existing_attachment/static/description/attachment.png new file mode 100644 index 00000000..0a6c2c23 Binary files /dev/null and b/mail_attach_existing_attachment/static/description/attachment.png differ diff --git a/mail_attach_existing_attachment/static/description/ex_mail_compose_message.png b/mail_attach_existing_attachment/static/description/ex_mail_compose_message.png new file mode 100644 index 00000000..c6437475 Binary files /dev/null and b/mail_attach_existing_attachment/static/description/ex_mail_compose_message.png differ diff --git a/mail_attach_existing_attachment/static/description/icon.png b/mail_attach_existing_attachment/static/description/icon.png new file mode 100644 index 00000000..0b6c4d89 Binary files /dev/null and b/mail_attach_existing_attachment/static/description/icon.png differ diff --git a/mail_attach_existing_attachment/static/description/index.html b/mail_attach_existing_attachment/static/description/index.html new file mode 100644 index 00000000..08e5cbbb --- /dev/null +++ b/mail_attach_existing_attachment/static/description/index.html @@ -0,0 +1,462 @@ + + + + + +Mail Attach Existing Attachment + + + +
+

Mail Attach Existing Attachment

+ + +

Beta License: AGPL-3 OCA/mail Translate me on Weblate Try me on Runboat

+

This module was written to add the possibility to add attachments +located on the object by sending it by email with the mail compose +message wizard

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  • Add some attachments on an object by creating a new Log note
  • +
+

image1

+
    +
  • Then, by sending the object via email, you can select the attachment +added earlier
  • +
+

image2

+
+
+

Known issues / Roadmap

+
    +
  • The module only allows the addition of attachments linked to the +object.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ACSONE SA/NV
  • +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/mail project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mail_attach_existing_attachment/tests/__init__.py b/mail_attach_existing_attachment/tests/__init__.py new file mode 100644 index 00000000..01f264cc --- /dev/null +++ b/mail_attach_existing_attachment/tests/__init__.py @@ -0,0 +1 @@ +from . import test_mail_attach_existing_attachment diff --git a/mail_attach_existing_attachment/tests/test_mail_attach_existing_attachment.py b/mail_attach_existing_attachment/tests/test_mail_attach_existing_attachment.py new file mode 100644 index 00000000..5e3fd481 --- /dev/null +++ b/mail_attach_existing_attachment/tests/test_mail_attach_existing_attachment.py @@ -0,0 +1,90 @@ +# Copyright 2015 ACSONE SA/NV +# Copyright 2024 360ERP () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests import Form, TransactionCase + + +class TestMailComposer(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.partner_01 = cls.env["res.partner"].create( + { + "name": "Partner 1", + "email": "partner1@example.org", + "is_company": True, + "parent_id": False, + } + ) + cls.attach1 = cls.env["ir.attachment"].create( + { + "name": "Attach1", + "datas": "bWlncmF0aW9uIHRlc3Q=", + "res_model": "res.partner", + "res_id": cls.partner_01.id, + } + ) + + def test_01_send_email_attachment(self): + """Test sending amail with attachment from Object Attachment of composer""" + # Open email composer + composer_form = Form( + self.env["mail.compose.message"].with_context( + default_composition_mode="comment", + default_model=self.partner_01._name, + default_res_ids=self.partner_01.ids, + ) + ) + + # Field can_attach_attachment is automatically set + self.assertTrue(composer_form.can_attach_attachment) + + # By default, no attachments are present + self.assertFalse(composer_form.partner_ids[:]) + self.assertEqual(len(composer_form.attachment_ids), 0) + self.assertEqual(len(composer_form.object_attachment_ids), 0) + + # One selectable Object Attachment is displayed + display_records = composer_form.display_object_attachment_ids._records + self.assertEqual(len(display_records), 1) + self.assertEqual(display_records[0]["id"], self.attach1.id) + + # Fill email composer with the Object Attachment + composer_form.partner_ids = self.partner_01 + composer_form.object_attachment_ids = self.attach1 + mail = composer_form.save() + + # Send email: the attachment is sent + values = mail._action_send_mail() + result_message = values[1] + self.assertEqual(result_message.attachment_ids, self.attach1) + + def test_02_prepare_mail_values(self): + """Test method _prepare_mail_values()""" + attach2 = self.attach1.copy() + # Create email composer with 2 Object Attachments + composer = ( + self.env["mail.compose.message"] + .with_context( + default_composition_mode="comment", + default_model=self.partner_01._name, + default_res_ids=self.partner_01.ids, + ) + .create( + { + "object_attachment_ids": (self.attach1 + attach2).ids, + } + ) + ) + + # Two selectable Object Attachments are displayed + display_records = composer.display_object_attachment_ids + self.assertEqual(len(display_records), 2) + self.assertIn(self.attach1, display_records) + self.assertIn(attach2, display_records) + + # Invoking _prepare_mail_values(): both attachment_ids are set + values = composer._prepare_mail_values(self.partner_01.ids) + self.assertIn(self.attach1.id, values[self.partner_01.id]["attachment_ids"]) + self.assertIn(attach2.id, values[self.partner_01.id]["attachment_ids"]) diff --git a/mail_attach_existing_attachment/wizard/__init__.py b/mail_attach_existing_attachment/wizard/__init__.py new file mode 100644 index 00000000..b528d997 --- /dev/null +++ b/mail_attach_existing_attachment/wizard/__init__.py @@ -0,0 +1 @@ +from . import mail_compose_message diff --git a/mail_attach_existing_attachment/wizard/mail_compose_message.py b/mail_attach_existing_attachment/wizard/mail_compose_message.py new file mode 100644 index 00000000..205893ff --- /dev/null +++ b/mail_attach_existing_attachment/wizard/mail_compose_message.py @@ -0,0 +1,57 @@ +# Copyright 2015 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class MailComposeMessage(models.TransientModel): + _inherit = "mail.compose.message" + + @api.model + def default_get(self, fields_list): + res = super().default_get(fields_list) + if ( + "can_attach_attachment" not in res + and res.get("model") + and res.get("res_ids") + and res.get("composition_mode", "") != "mass_mail" + ): + res["can_attach_attachment"] = True # pragma: no cover + return res + + can_attach_attachment = fields.Boolean() + object_attachment_ids = fields.Many2many( + comodel_name="ir.attachment", + relation="mail_compose_message_ir_attachments_object_rel", + column1="wizard_id", + column2="attachment_id", + string="Object Attachments", + ) + display_object_attachment_ids = fields.One2many( + comodel_name="ir.attachment", + compute="_compute_display_object_attachment_ids", + ) + + @api.depends("res_ids", "model") + def _compute_display_object_attachment_ids(self): + for composer in self: + res_ids = self._evaluate_res_ids() + model = self.model + if model and res_ids: + attachments = self.env["ir.attachment"].search( + [ + ("res_model", "=", model), + ("res_id", "in", res_ids), + ] + ) + composer.display_object_attachment_ids = attachments + else: + composer.display_object_attachment_ids = False + + def _prepare_mail_values(self, res_ids): + res = super()._prepare_mail_values(res_ids) + if self.object_attachment_ids.ids and self.model and len(res_ids) == 1: + res[res_ids[0]].setdefault("attachment_ids", []).extend( + self.object_attachment_ids.ids + ) + return res diff --git a/mail_attach_existing_attachment/wizard/mail_compose_message_view.xml b/mail_attach_existing_attachment/wizard/mail_compose_message_view.xml new file mode 100644 index 00000000..e0b81625 --- /dev/null +++ b/mail_attach_existing_attachment/wizard/mail_compose_message_view.xml @@ -0,0 +1,19 @@ + + + + mail.compose.message + + + + + + + + + +