Browse Source
Merge pull request #280 from Tecnativa/11.0-PR-mail_tracking_mailgun-sudo-parameter
[11.0][FIX] mail_tracking_mailgun: Read config parameters with sudo
pull/281/head
Pedro M. Baeza
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
5 deletions
-
mail_tracking_mailgun/__manifest__.py
-
mail_tracking_mailgun/models/res_partner.py
|
|
@ -6,7 +6,7 @@ |
|
|
|
{ |
|
|
|
"name": "Mail tracking for Mailgun", |
|
|
|
"summary": "Mail tracking and Mailgun webhooks integration", |
|
|
|
"version": "11.0.1.0.2", |
|
|
|
"version": "11.0.1.0.3", |
|
|
|
"category": "Social Network", |
|
|
|
"website": "https://github.com/OCA/social", |
|
|
|
"author": "Tecnativa, " |
|
|
|
|
|
@ -147,13 +147,15 @@ class ResPartner(models.Model): |
|
|
|
|
|
|
|
@api.model |
|
|
|
def create(self, vals): |
|
|
|
if 'email' in vals and self.env['ir.config_parameter'].get_param( |
|
|
|
'mailgun.auto_check_partner_email'): |
|
|
|
if ('email' in vals and |
|
|
|
self.env['ir.config_parameter'].sudo().get_param( |
|
|
|
'mailgun.auto_check_partner_email')): |
|
|
|
self._autocheck_partner_email() |
|
|
|
return super(ResPartner, self).create(vals) |
|
|
|
|
|
|
|
def write(self, vals): |
|
|
|
if 'email' in vals and self.env['ir.config_parameter'].get_param( |
|
|
|
'mailgun.auto_check_partner_email'): |
|
|
|
if ('email' in vals and |
|
|
|
self.env['ir.config_parameter'].sudo().get_param( |
|
|
|
'mailgun.auto_check_partner_email')): |
|
|
|
self._autocheck_partner_email() |
|
|
|
return super(ResPartner, self).write(vals) |