[FIX] ean13 field in res.partner and res.users renamed in Barcode (only in views) + no more check_ean done on these fields

This commit is contained in:
Aaron Bohy
2014-11-26 11:46:18 +01:00
committed by Frédéric van der Essen
parent 97039fb591
commit eb43fbe248
2 changed files with 20 additions and 18 deletions
+10 -9
View File
@@ -9,16 +9,17 @@ import openerp.addons.product.product
class res_users(osv.osv):
_inherit = 'res.partner'
_columns = {
'ean13' : fields.char('EAN13', size=13, help="BarCode"),
# 'ean13' : fields.char('EAN13', size=13, help="BarCode"),
'ean13' : fields.char('Barcode', help="BarCode"),
}
def _check_ean(self, cr, uid, ids, context=None):
return all(
openerp.addons.product.product.check_ean(user.ean13) == True
for user in self.browse(cr, uid, ids, context=context)
)
# def _check_ean(self, cr, uid, ids, context=None):
# return all(
# openerp.addons.product.product.check_ean(user.ean13) == True
# for user in self.browse(cr, uid, ids, context=context)
# )
_constraints = [
(_check_ean, "Error: Invalid ean code", ['ean13'],),
]
# _constraints = [
# (_check_ean, "Error: Invalid ean code", ['ean13'],),
# ]
+10 -9
View File
@@ -9,17 +9,18 @@ import openerp.addons.product.product
class res_users(osv.osv):
_inherit = 'res.users'
_columns = {
'ean13' : fields.char('EAN13', size=13, help="BarCode"),
# 'ean13' : fields.char('EAN13', size=13, help="BarCode"),
'ean13' : fields.char('Barcode', help="BarCode"),
'pos_config' : fields.many2one('pos.config', 'Default Point of Sale', domain=[('state', '=', 'active')]),
}
def _check_ean(self, cr, uid, ids, context=None):
return all(
openerp.addons.product.product.check_ean(user.ean13) == True
for user in self.browse(cr, uid, ids, context=context)
)
# def _check_ean(self, cr, uid, ids, context=None):
# return all(
# openerp.addons.product.product.check_ean(user.ean13) == True
# for user in self.browse(cr, uid, ids, context=context)
# )
_constraints = [
(_check_ean, "Error: Invalid ean code", ['ean13'],),
]
# _constraints = [
# (_check_ean, "Error: Invalid ean code", ['ean13'],),
# ]