Browse Source

[IMP] move the sent of the capital release request in a separate

function to allow overriding it by other module to exclude the sending
is some use cases.
pull/1/head
houssine 8 years ago
parent
commit
474016e0d0
  1. 13
      easy_my_coop/models/coop.py

13
easy_my_coop/models/coop.py

@ -181,6 +181,13 @@ class subscription_request(models.Model):
} }
return res return res
def send_capital_release_request(self, invoice):
invoice_email_template = self.env['mail.template'].search([('name', '=', 'Request to Release Capital - Send by Email')])[0]
# we send the email with the capital release request in attachment
invoice_email_template.send_mail(invoice.id, True)
invoice.sent = True
def create_invoice(self, partner): def create_invoice(self, partner):
# get subscription journal # get subscription journal
journal = self.env['account.journal'].search([('code','=','SUBJ')])[0] journal = self.env['account.journal'].search([('code','=','SUBJ')])[0]
@ -203,11 +210,7 @@ class subscription_request(models.Model):
# validate the capital release request # validate the capital release request
invoice.signal_workflow('invoice_open') invoice.signal_workflow('invoice_open')
invoice_email_template = self.env['mail.template'].search([('name', '=', 'Request to Release Capital - Send by Email')])[0]
# we send the email with the capital release request in attachment
invoice_email_template.send_mail(invoice.id, True)
invoice.sent = True
self.send_capital_release_request(invoice)
return invoice return invoice

Loading…
Cancel
Save