Browse Source

fix to pep8

pull/1/head^2
Ilnur Gallyamov 10 years ago
parent
commit
c436a35138
  1. 4
      __openerp__.py
  2. 26
      models.py

4
__openerp__.py

@ -3,8 +3,8 @@
'name': "Trim email's field",
'summary': """""",
'description': """""",
'author': "It-Projects LLC",
'website': "https://www.it-projects.info/",
'author': "Ivan Yelizariev",
'website': "https://yelizariev.github.io",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml

26
models.py

@ -4,18 +4,18 @@ from openerp import models, fields, api
class res_partner_strip_email(models.Model):
_inherit = 'res.partner'
_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.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
Loading…
Cancel
Save