From de1ddbb320d30dd8ec605933eed6bc759ac9ded7 Mon Sep 17 00:00:00 2001 From: Sergio Teruel Albert Date: Wed, 30 May 2018 10:07:51 +0200 Subject: [PATCH] [11.0][FIX] mail_tracking_mailgun: Read config parameters with sudo --- mail_tracking_mailgun/__manifest__.py | 2 +- mail_tracking_mailgun/models/res_partner.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mail_tracking_mailgun/__manifest__.py b/mail_tracking_mailgun/__manifest__.py index 8eba3739..5fdc44b9 100644 --- a/mail_tracking_mailgun/__manifest__.py +++ b/mail_tracking_mailgun/__manifest__.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, " diff --git a/mail_tracking_mailgun/models/res_partner.py b/mail_tracking_mailgun/models/res_partner.py index 7d13bae6..c3cf0164 100644 --- a/mail_tracking_mailgun/models/res_partner.py +++ b/mail_tracking_mailgun/models/res_partner.py @@ -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)