diff --git a/mail_attach_existing_attachment/README.rst b/mail_attach_existing_attachment/README.rst index 50784be..d81fb58 100644 --- a/mail_attach_existing_attachment/README.rst +++ b/mail_attach_existing_attachment/README.rst @@ -31,7 +31,7 @@ To configure this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/205/8.0 + :target: https://runbot.odoo-community.org/runbot/205/9.0 Known issues / Roadmap ====================== @@ -41,10 +41,10 @@ Known issues / Roadmap 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 -`here `_. +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. Credits ======= @@ -53,6 +53,7 @@ Contributors ------------ * Adrien Peiffer +* Sergio Teruel Maintainer ---------- @@ -65,4 +66,4 @@ This module is maintained by the OCA. 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. -To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit http://odoo-community.org. diff --git a/mail_attach_existing_attachment/__openerp__.py b/mail_attach_existing_attachment/__openerp__.py index 7ec7bbb..58f1642 100644 --- a/mail_attach_existing_attachment/__openerp__.py +++ b/mail_attach_existing_attachment/__openerp__.py @@ -26,10 +26,12 @@ 'name': "Mail Attach Existing Attachment", 'summary': """ Adding attachment on the object by sending this one""", - 'author': "ACSONE SA/NV,Odoo Community Association (OCA)", + 'author': "ACSONE SA/NV," + "Tecnativa," + "Odoo Community Association (OCA)", 'website': "http://acsone.eu", 'category': 'Social Network', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'license': 'AGPL-3', 'depends': [ 'mail', @@ -38,4 +40,5 @@ '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 0000000..f5334ac --- /dev/null +++ b/mail_attach_existing_attachment/i18n/ca.po @@ -0,0 +1,33 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ca\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 0000000..98e6791 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/de.po @@ -0,0 +1,33 @@ +# 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: German (http://www.transifex.com/oca/OCA-social-9-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\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 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 0000000..3db638d --- /dev/null +++ b/mail_attach_existing_attachment/i18n/es.po @@ -0,0 +1,33 @@ +# 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 (http://www.transifex.com/oca/OCA-social-9-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\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 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 0000000..0d62d5f --- /dev/null +++ b/mail_attach_existing_attachment/i18n/es_CO.po @@ -0,0 +1,33 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_CO\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 0000000..b846422 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/fr.po @@ -0,0 +1,33 @@ +# 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: French (http://www.transifex.com/oca/OCA-social-9-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\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 "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 0000000..49b0ed7 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/hr.po @@ -0,0 +1,34 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\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/pt_BR.po b/mail_attach_existing_attachment/i18n/pt_BR.po index b74de81..df34c99 100644 --- a/mail_attach_existing_attachment/i18n/pt_BR.po +++ b/mail_attach_existing_attachment/i18n/pt_BR.po @@ -6,12 +6,12 @@ # Armando Vulcano Junior , 2015 msgid "" msgstr "" -"Project-Id-Version: social (8.0)\n" +"Project-Id-Version: social (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-30 16:56+0000\n" -"PO-Revision-Date: 2015-09-18 19:58+0000\n" -"Last-Translator: Armando Vulcano Junior \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-social-8-0/language/pt_BR/)\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" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,12 +19,12 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: mail_attach_existing_attachment -#: field:mail.compose.message,object_attachment_ids:0 +#: 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 -#: field:mail.compose.message,can_attach_attachment:0 +#: 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" diff --git a/mail_attach_existing_attachment/i18n/sl.po b/mail_attach_existing_attachment/i18n/sl.po index 2f00e5d..2899f71 100644 --- a/mail_attach_existing_attachment/i18n/sl.po +++ b/mail_attach_existing_attachment/i18n/sl.po @@ -6,12 +6,12 @@ # Matjaž Mozetič , 2015 msgid "" msgstr "" -"Project-Id-Version: social (8.0)\n" +"Project-Id-Version: social (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-04 14:42+0000\n" -"PO-Revision-Date: 2015-09-07 14:25+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-social-8-0/language/sl/)\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" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,12 +19,12 @@ msgstr "" "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 -#: field:mail.compose.message,object_attachment_ids:0 +#: 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 -#: field:mail.compose.message,can_attach_attachment:0 +#: 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" 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 0000000..49469d7 --- /dev/null +++ b/mail_attach_existing_attachment/i18n/zh_CN.po @@ -0,0 +1,34 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\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/static/description/icon.png b/mail_attach_existing_attachment/static/description/icon.png new file mode 100644 index 0000000..0b6c4d8 Binary files /dev/null and b/mail_attach_existing_attachment/static/description/icon.png differ 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 index eed39bc..af1aaae 100644 --- a/mail_attach_existing_attachment/tests/test_mail_attach_existing_attachment.py +++ b/mail_attach_existing_attachment/tests/test_mail_attach_existing_attachment.py @@ -44,6 +44,6 @@ class TestAttachExistingAttachment(common.TransactionCase): 'object_attachment_ids': [(6, 0, [attach1.id])] } mail = self.env['mail.compose.message'].create(vals) - values = mail.get_mail_values(mail, [self.partner_01.id]) + 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/mail_compose_message.py b/mail_attach_existing_attachment/wizard/mail_compose_message.py index 4c7d43f..6e154a1 100644 --- a/mail_attach_existing_attachment/wizard/mail_compose_message.py +++ b/mail_attach_existing_attachment/wizard/mail_compose_message.py @@ -35,7 +35,7 @@ class MailComposeMessage(models.TransientModel): 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 + res['can_attach_attachment'] = True # pragma: no cover return res can_attach_attachment = fields.Boolean(string='Can Attach Attachment') @@ -44,14 +44,10 @@ class MailComposeMessage(models.TransientModel): relation='mail_compose_message_ir_attachments_object_rel', column1='wizard_id', column2='attachment_id', string='Attachments') - @api.model - def get_mail_values(self, wizard, res_ids): - res = super(MailComposeMessage, self).get_mail_values(wizard, res_ids) - if wizard.object_attachment_ids.ids and wizard.model and\ - len(res_ids) == 1: - for res_id in res_ids: - if not res[res_id].get('attachment_ids'): - res[res_id]['attachment_ids'] = [] - res[res_id]['attachment_ids'].extend( - wizard.object_attachment_ids.ids) + @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