[FIX] website_event_sale: remove invalid code chunk introduced during previous forwar...
[odoo/odoo.git] / addons / point_of_sale / res_partner.py
1
2 import math
3
4 from openerp.osv import osv, fields
5
6 import openerp.addons.product.product
7
8
9 class res_users(osv.osv):
10     _inherit = 'res.partner'
11     _columns = {
12         'ean13' : fields.char('EAN13', size=13, help="BarCode"),
13     }
14
15     def _check_ean(self, cr, uid, ids, context=None):
16         return all(
17             openerp.addons.product.product.check_ean(user.ean13) == True
18             for user in self.browse(cr, uid, ids, context=context)
19         )
20
21     _constraints = [
22         (_check_ean, "Error: Invalid ean code", ['ean13'],),
23     ]
24