Browse Source

[FIX] comment init method

pull/37/head
houssine 5 years ago
committed by Rémy Taymans
parent
commit
dcb3c680fd
  1. 18
      easy_my_coop/models/mail_template.py
  2. 1
      easy_my_coop_loan/data/mail_template_data.xml
  3. 13
      easy_my_coop_loan/models/mail_template.py
  4. 12
      easy_my_coop_taxshelter_report/models/mail_template.py

18
easy_my_coop/models/mail_template.py

@ -1,22 +1,12 @@
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
# 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")

1
easy_my_coop_loan/data/mail_template_data.xml

@ -3,7 +3,6 @@
<!-- Mail template are declared in a NOUPDATE block
so users can freely customize/delete them -->
<data noupdate="1">
<!--<data>-->
<record id="loan_subscription_confirmation" model="mail.template">
<field name="name">Loan Subscription Confirmation Email</field>
<field name="email_from">${(object.company_id.coop_email_contact or object.loan_issue_id.user_id.email)|safe}</field>

13
easy_my_coop_loan/models/mail_template.py

@ -1,15 +1,10 @@
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
# def init(self):
# for template_id in EMAIL_TEMPLATE_IDS:
# mail_template = self.env.ref(template_id)
# mail_template.easy_my_coop = True

12
easy_my_coop_taxshelter_report/models/mail_template.py

@ -1,17 +1,13 @@
from odoo import api, models
EMAIL_TEMPLATE_IDS = [
"easy_my_coop_taxshelter_report.email_template_tax_shelter_certificate",
]
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
# 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,

Loading…
Cancel
Save