2 from osv import osv, fields
4 import openerp.addons.product.product
7 class res_users(osv.osv):
10 'ean13' : fields.char('EAN13', size=13, help="BarCode"),
11 'pos_config' : fields.many2one('pos.config', 'Default Point of Sale', domain=[('state', '=', 'active')]),
14 def _check_ean(self, cr, uid, ids, context=None):
16 openerp.addons.product.product.check_ean(user.ean13) == True
17 for user in self.browse(cr, uid, ids, context=context)
20 def edit_ean(self, cr, uid, ids, context):
23 'type': 'ir.actions.act_window',
26 'res_model': 'pos.ean_wizard',
33 (_check_ean, "Error: Invalid ean code", ['ean13'],),