diff --git a/mail_attach_existing_attachment/README.rst b/mail_attach_existing_attachment/README.rst new file mode 100644 index 00000000..019b81d2 --- /dev/null +++ b/mail_attach_existing_attachment/README.rst @@ -0,0 +1,99 @@ +=============================== +Mail Attach Existing Attachment +=============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github + :target: https://github.com/OCA/social/tree/12.0/mail_attach_existing_attachment + :alt: OCA/social +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/social-12-0/social-12-0-mail_attach_existing_attachment + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/205/12.0 + :alt: Try me on Runbot + +|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: + +* Adding some attachments on an object by creating a new *Log note* + +.. figure:: mail_attach_existing_attachment/static/description/attachment.png + :alt: Attachment on purchase order + +* Then, by sending the object via email, you can select the attachment added earlier + +.. figure:: mail_attach_existing_attachment/static/description/ex_mail_compose_message.png + :alt: Sends the Purchase Order by email + +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 smashing 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 +* `Tecnativa `_: + + * Sergio Teruel + * Ernesto Tejeda + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/social `_ 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..c907555e --- /dev/null +++ b/mail_attach_existing_attachment/__manifest__.py @@ -0,0 +1,42 @@ +############################################################################## +# +# This file is part of mail_attach_existing_attachment, +# an Odoo module. +# +# Copyright (c) 2015 ACSONE SA/NV () +# +# mail_attach_existing_attachment is free software: +# you can redistribute it and/or modify it under the terms of the GNU +# Affero General Public License as published by the Free Software +# Foundation,either version 3 of the License, or (at your option) any +# later version. +# +# mail_attach_existing_attachment is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with mail_attach_existing_attachment. +# If not, see . +# +############################################################################## +{ + '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/social", + 'category': 'Social Network', + 'version': '12.0.1.0.0', + 'license': 'AGPL-3', + 'depends': [ + 'mail', + 'document', + ], + '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..78413f42 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/ca.po @@ -0,0 +1,34 @@ +# 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_object_attachment_ids +msgid "Attachments" +msgstr "" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistent per composició de correus electrònics" diff --git a/mail_attach_existing_attachment/i18n/de.po b/mail_attach_existing_attachment/i18n/de.po new file mode 100644 index 00000000..2c6e2632 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/de.po @@ -0,0 +1,35 @@ +# 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_object_attachment_ids +msgid "Attachments" +msgstr "Anhänge" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistent zum Email verfassen" diff --git a/mail_attach_existing_attachment/i18n/es.po b/mail_attach_existing_attachment/i18n/es.po new file mode 100644 index 00000000..95e6980e --- /dev/null +++ b/mail_attach_existing_attachment/i18n/es.po @@ -0,0 +1,35 @@ +# 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: 2017-12-01 02:19+0000\n" +"Last-Translator: Pedro M. Baeza , 2017\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" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message_object_attachment_ids +msgid "Attachments" +msgstr "Adjuntos" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Asistente composición Correo Electrónico" 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..25924b96 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/es_CO.po @@ -0,0 +1,34 @@ +# 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_object_attachment_ids +msgid "Attachments" +msgstr "" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Asistente de redacción de E-mail" diff --git a/mail_attach_existing_attachment/i18n/fr.po b/mail_attach_existing_attachment/i18n/fr.po new file mode 100644 index 00000000..a420ef1b --- /dev/null +++ b/mail_attach_existing_attachment/i18n/fr.po @@ -0,0 +1,35 @@ +# 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_object_attachment_ids +msgid "Attachments" +msgstr "Pièces jointes" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistant de composition de courriel" diff --git a/mail_attach_existing_attachment/i18n/hr.po b/mail_attach_existing_attachment/i18n/hr.po new file mode 100644 index 00000000..5ceb5fb3 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/hr.po @@ -0,0 +1,36 @@ +# 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_object_attachment_ids +msgid "Attachments" +msgstr "Privitci" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Čarobnjak za sastavljanje maila" diff --git a/mail_attach_existing_attachment/i18n/it.po b/mail_attach_existing_attachment/i18n/it.po new file mode 100644 index 00000000..6930c7db --- /dev/null +++ b/mail_attach_existing_attachment/i18n/it.po @@ -0,0 +1,35 @@ +# 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: 2017-05-17 01:02+0000\n" +"Last-Translator: Marius Marolla , 2017\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" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message_object_attachment_ids +msgid "Attachments" +msgstr "Allegati" + +#. 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 "Inserimento Allegati Ammesso" + +#. module: mail_attach_existing_attachment +#: model:ir.model,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Wizard Creazione Email" 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..266b4463 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/mail_attach_existing_attachment.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_attach_existing_attachment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.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_object_attachment_ids +msgid "Attachments" +msgstr "" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +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..3205cc48 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/pt_BR.po @@ -0,0 +1,35 @@ +# 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: 2016-06-13 03:11+0000\n" +"Last-Translator: OCA Transbot \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" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message_object_attachment_ids +msgid "Attachments" +msgstr "Anexos" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistente de Composição de Email" diff --git a/mail_attach_existing_attachment/i18n/sl.po b/mail_attach_existing_attachment/i18n/sl.po new file mode 100644 index 00000000..76343af0 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/sl.po @@ -0,0 +1,36 @@ +# 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: 2016-06-13 03:11+0000\n" +"Last-Translator: OCA Transbot \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" + +#. module: mail_attach_existing_attachment +#: model:ir.model.fields,field_description:mail_attach_existing_attachment.field_mail_compose_message_object_attachment_ids +msgid "Attachments" +msgstr "Priponke" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Čarovnik za sestavljanje e-pošte" 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..2fdf0f0a --- /dev/null +++ b/mail_attach_existing_attachment/i18n/zh_CN.po @@ -0,0 +1,35 @@ +# 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_object_attachment_ids +msgid "Attachments" +msgstr "附件" + +#. 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,name:mail_attach_existing_attachment.model_mail_compose_message +msgid "Email composition wizard" +msgstr "" diff --git a/mail_attach_existing_attachment/readme/CONTRIBUTORS.rst b/mail_attach_existing_attachment/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..db6910ff --- /dev/null +++ b/mail_attach_existing_attachment/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Adrien Peiffer +* `Tecnativa `_: + + * Sergio Teruel + * Ernesto Tejeda diff --git a/mail_attach_existing_attachment/readme/DESCRIPTION.rst b/mail_attach_existing_attachment/readme/DESCRIPTION.rst new file mode 100644 index 00000000..189719c2 --- /dev/null +++ b/mail_attach_existing_attachment/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +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.rst b/mail_attach_existing_attachment/readme/ROADMAP.rst new file mode 100644 index 00000000..5d24095f --- /dev/null +++ b/mail_attach_existing_attachment/readme/ROADMAP.rst @@ -0,0 +1 @@ +* The module only allows the addition of attachments linked to the object. diff --git a/mail_attach_existing_attachment/readme/USAGE.rst b/mail_attach_existing_attachment/readme/USAGE.rst new file mode 100644 index 00000000..22a328e9 --- /dev/null +++ b/mail_attach_existing_attachment/readme/USAGE.rst @@ -0,0 +1,11 @@ +To use this module, you need to: + +* Adding some attachments on an object by creating a new *Log note* + +.. figure:: mail_attach_existing_attachment/static/description/attachment.png + :alt: Attachment on purchase order + +* Then, by sending the object via email, you can select the attachment added earlier + +.. figure:: mail_attach_existing_attachment/static/description/ex_mail_compose_message.png + :alt: Sends the Purchase Order by email 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..428ee588 --- /dev/null +++ b/mail_attach_existing_attachment/static/description/index.html @@ -0,0 +1,450 @@ + + + + + + +Mail Attach Existing Attachment + + + +
+

Mail Attach Existing Attachment

+ + +

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runbot

+

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:

+
    +
  • Adding some attachments on an object by creating a new Log note
  • +
+
+Attachment on purchase order +
+
    +
  • Then, by sending the object via email, you can select the attachment added earlier
  • +
+
+Sends the Purchase Order by email +
+
+
+

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 smashing 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/social 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..fc1e8e4e --- /dev/null +++ b/mail_attach_existing_attachment/tests/__init__.py @@ -0,0 +1,2 @@ + +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..a6730e77 --- /dev/null +++ b/mail_attach_existing_attachment/tests/test_mail_attach_existing_attachment.py @@ -0,0 +1,53 @@ +############################################################################## +# +# This file is part of mail_attach_existing_attachment, +# an Odoo module. +# +# Copyright (c) 2015 ACSONE SA/NV () +# +# mail_attach_existing_attachment is free software: +# you can redistribute it and/or modify it under the terms of the GNU +# Affero General Public License as published by the Free Software +# Foundation,either version 3 of the License, or (at your option) any +# later version. +# +# mail_attach_existing_attachment is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with mail_attach_existing_attachment. +# If not, see . +# +############################################################################## + +from odoo.tests import common + + +class TestAttachExistingAttachment(common.TransactionCase): + + def setUp(self): + super(TestAttachExistingAttachment, self).setUp() + self.partner_obj = self.env['res.partner'] + self.partner_01 = self.env['res.partner'].create({ + 'name': 'Partner 1', + 'email': 'partner1@example.org', + 'is_company': True, + 'parent_id': False, + }) + + def test_send_email_attachment(self): + attach1 = self.env['ir.attachment'].create({ + 'name': 'Attach1', 'datas_fname': 'Attach1', + 'datas': 'bWlncmF0aW9uIHRlc3Q=', + 'res_model': 'res.partner', 'res_id': self.partner_01.id}) + vals = {'model': 'res.partner', + 'partner_ids': [(6, 0, [self.partner_01.id])], + 'res_id': self.partner_01.id, + 'object_attachment_ids': [(6, 0, [attach1.id])] + } + mail = self.env['mail.compose.message'].create(vals) + values = mail.get_mail_values([self.partner_01.id]) + self.assertTrue(attach1.id in + 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..5b4b32e5 --- /dev/null +++ b/mail_attach_existing_attachment/wizard/mail_compose_message.py @@ -0,0 +1,53 @@ +############################################################################## +# +# This file is part of mail_attach_existing_attachment, +# an Odoo module. +# +# Copyright (c) 2015 ACSONE SA/NV () +# +# mail_attach_existing_attachment is free software: +# you can redistribute it and/or modify it under the terms of the GNU +# Affero General Public License as published by the Free Software +# Foundation,either version 3 of the License, or (at your option) any +# later version. +# +# mail_attach_existing_attachment is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with mail_attach_existing_attachment. +# If not, see . +# +############################################################################## + +from odoo import models, fields, api + + +class MailComposeMessage(models.TransientModel): + _inherit = 'mail.compose.message' + + @api.model + def default_get(self, fields_list): + res = super(MailComposeMessage, self).default_get(fields_list) + if res.get('res_id') and res.get('model') and \ + res.get('composition_mode', '') != 'mass_mail' and\ + not res.get('can_attach_attachment'): + res['can_attach_attachment'] = True # pragma: no cover + return res + + can_attach_attachment = fields.Boolean(string='Can Attach Attachment') + 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') + + @api.multi + def get_mail_values(self, res_ids): + res = super(MailComposeMessage, self).get_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..d79a0342 --- /dev/null +++ b/mail_attach_existing_attachment/wizard/mail_compose_message_view.xml @@ -0,0 +1,17 @@ + + + + mail.compose.message.form (mail_attach_existing_attachment) + mail.compose.message + + + + +
+
+ +
+
+
+
+