|
@ -2,19 +2,20 @@ |
|
|
|
|
|
|
|
|
from openerp import models, fields, api |
|
|
from openerp import models, fields, api |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class res_partner_strip_email(models.Model): |
|
|
class res_partner_strip_email(models.Model): |
|
|
_inherit = 'res.partner' |
|
|
|
|
|
|
|
|
|
|
|
@api.one |
|
|
|
|
|
def write(self, vals): |
|
|
|
|
|
if 'email' in vals: |
|
|
|
|
|
vals['email']=vals['email'].strip() |
|
|
|
|
|
res = super(res_partner_strip_email, self).write(vals) |
|
|
|
|
|
return res |
|
|
|
|
|
|
|
|
_inherit = 'res.partner' |
|
|
|
|
|
|
|
|
|
|
|
@api.one |
|
|
|
|
|
def write(self, vals): |
|
|
|
|
|
if 'email' in vals and type(vals['email']) is not bool: |
|
|
|
|
|
vals['email'] = vals['email'].strip() |
|
|
|
|
|
res = super(res_partner_strip_email, self).write(vals) |
|
|
|
|
|
return res |
|
|
|
|
|
|
|
|
@api.model |
|
|
|
|
|
def create(self, vals): |
|
|
|
|
|
if vals['email']: |
|
|
|
|
|
vals['email']=vals['email'].strip() |
|
|
|
|
|
res = super(res_partner_strip_email, self).create(vals) |
|
|
|
|
|
return res |
|
|
|
|
|
|
|
|
@api.model |
|
|
|
|
|
def create(self, vals): |
|
|
|
|
|
if vals['email']: |
|
|
|
|
|
vals['email'] = vals['email'].strip() |
|
|
|
|
|
res = super(res_partner_strip_email, self).create(vals) |
|
|
|
|
|
return res |