diff --git a/easy_my_coop/__manifest__.py b/easy_my_coop/__manifest__.py index 310f184..03179d2 100644 --- a/easy_my_coop/__manifest__.py +++ b/easy_my_coop/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Easy My Coop', - 'version': '12.0.2.0.2', + 'version': '12.0.3.0.1', 'depends': [ 'base', 'web', diff --git a/easy_my_coop/data/mail_template_data.xml b/easy_my_coop/data/mail_template_data.xml index be29a3e..ca4a566 100644 --- a/easy_my_coop/data/mail_template_data.xml +++ b/easy_my_coop/data/mail_template_data.xml @@ -15,6 +15,7 @@ ${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''} ${object.partner_id.lang} + @@ -65,6 +66,7 @@ ${object.lang} + @@ -117,6 +119,7 @@ ${object.lang} + @@ -166,7 +169,6 @@ Payment Received Confirmation - Send By Email ${(object.company_id.coop_email_contact or object.user_id.email)|safe} Payment Received Confirmation - ${object.id} ${(object.company_id.coop_email_contact or object.user_id.email)|safe} @@ -174,6 +176,7 @@ Certificat ${(object.cooperator_register_number or '')} ${object.lang} + @@ -228,6 +231,7 @@ Certificat ${(object.cooperator_register_number or '')} ${object.lang} + @@ -282,6 +286,7 @@ Certificat ${(object.cooperator_register_number or '')} ${object.lang} + @@ -336,6 +341,7 @@ Certificat ${(object.cooperator_register_number or '')} ${object.lang} + diff --git a/easy_my_coop/models/__init__.py b/easy_my_coop/models/__init__.py index 9f09fa5..38eb166 100644 --- a/easy_my_coop/models/__init__.py +++ b/easy_my_coop/models/__init__.py @@ -6,3 +6,4 @@ from . import account_invoice from . import company from . import res_partner_bank from . import account_journal +from . import mail_template diff --git a/easy_my_coop/models/mail_template.py b/easy_my_coop/models/mail_template.py new file mode 100644 index 0000000..76be7e0 --- /dev/null +++ b/easy_my_coop/models/mail_template.py @@ -0,0 +1,22 @@ +from odoo import models, fields + +EMAIL_TEMPLATE_IDS = [ + "easy_my_coop.email_template_release_capital", + "easy_my_coop.email_template_confirmation", + "easy_my_coop.email_template_confirmation_company", + "easy_my_coop.email_template_certificat", + "easy_my_coop.email_template_certificat_increase", + "easy_my_coop.email_template_share_transfer", + "easy_my_coop.email_template_share_update" + ] + + +class MailTemplate(models.Model): + _inherit = "mail.template" + + def init(self): + for template_id in EMAIL_TEMPLATE_IDS: + mail_template = self.env.ref(template_id) + mail_template.easy_my_coop = True + + easy_my_coop = fields.Boolean(string="Easy my coop mail template") diff --git a/easy_my_coop/views/email_template_view.xml b/easy_my_coop/views/email_template_view.xml index 3b54efb..6834a80 100644 --- a/easy_my_coop/views/email_template_view.xml +++ b/easy_my_coop/views/email_template_view.xml @@ -7,6 +7,7 @@ mail.template form form,tree + [('easy_my_coop','=',True)] diff --git a/easy_my_coop_loan/data/mail_template_data.xml b/easy_my_coop_loan/data/mail_template_data.xml index eb67939..878ebad 100644 --- a/easy_my_coop_loan/data/mail_template_data.xml +++ b/easy_my_coop_loan/data/mail_template_data.xml @@ -13,6 +13,7 @@ ${object.partner_id.lang} + @@ -65,6 +66,7 @@ ${object.partner_id.lang} + diff --git a/easy_my_coop_loan/models/__init__.py b/easy_my_coop_loan/models/__init__.py index d997735..21d0546 100644 --- a/easy_my_coop_loan/models/__init__.py +++ b/easy_my_coop_loan/models/__init__.py @@ -2,3 +2,4 @@ from . import loan from . import loan_issue_line from . import interest_line from . import partner +from . import mail_template diff --git a/easy_my_coop_loan/models/mail_template.py b/easy_my_coop_loan/models/mail_template.py new file mode 100644 index 0000000..0efac37 --- /dev/null +++ b/easy_my_coop_loan/models/mail_template.py @@ -0,0 +1,15 @@ +from odoo import models + +EMAIL_TEMPLATE_IDS = [ + "easy_my_coop_loan.loan_subscription_confirmation", + "easy_my_coop_loan.loan_issue_payment_request", + ] + + +class MailTemplate(models.Model): + _inherit = "mail.template" + + def init(self): + for template_id in EMAIL_TEMPLATE_IDS: + mail_template = self.env.ref(template_id) + mail_template.easy_my_coop = True diff --git a/easy_my_coop_taxshelter_report/data/mail_template_data.xml b/easy_my_coop_taxshelter_report/data/mail_template_data.xml index 82d01bc..d896022 100644 --- a/easy_my_coop_taxshelter_report/data/mail_template_data.xml +++ b/easy_my_coop_taxshelter_report/data/mail_template_data.xml @@ -1,4 +1,4 @@ - + @@ -11,6 +11,7 @@ ${object.partner_id.lang} +

Hello ${object.partner_id.name},

@@ -51,6 +52,5 @@ ]]>
-
-
+ diff --git a/easy_my_coop_taxshelter_report/models/mail_template.py b/easy_my_coop_taxshelter_report/models/mail_template.py index feffb2b..585c0bd 100644 --- a/easy_my_coop_taxshelter_report/models/mail_template.py +++ b/easy_my_coop_taxshelter_report/models/mail_template.py @@ -1,18 +1,25 @@ -# -*- coding: utf-8 -*- -from openerp import api, models +from odoo import api, models +EMAIL_TEMPLATE_IDS = [ + "easy_my_coop_taxshelter_report.email_template_tax_shelter_certificate", + ] -class MailTemplate(models.Model): +class MailTemplate(models.Model): _inherit = "mail.template" + def init(self): + for template_id in EMAIL_TEMPLATE_IDS: + mail_template = self.env.ref(template_id) + mail_template.easy_my_coop = True + @api.multi def send_mail_with_multiple_attachments(self, res_id, additional_attachments, force_send=False, raise_exception=False): """Generates a new mail message for the given template and record, - and schedules it for delivery through the ``mail`` + and schedules it for delivery through the ``mail`` module's scheduler. :param int res_id: id of the record to render the template with @@ -24,7 +31,8 @@ class MailTemplate(models.Model): """ self.ensure_one() Mail = self.env['mail.mail'] - Attachment = self.env['ir.attachment'] # TDE FIXME: should remove dfeault_type from context + # TDE FIXME: should remove dfeault_type from context + Attachment = self.env['ir.attachment'] # create a mail_mail based on values, without attachments values = self.generate_email(res_id)