'modules': fields.function(_in_modules, method=True, type='char', size=128, string='In modules', help='List of modules in which the object is defined or inherited'),
'view_ids': fields.function(_view_ids, method=True, type='one2many', obj='ir.ui.view', string='Views'),
}
-
+ _sql_constraints = [
+ ('obj_name_uniq', 'unique (name)', 'The object name must be unique !'),
+ ]
_defaults = {
'model': lambda *a: 'x_',
'state': lambda self,cr,uid,ctx=None: (ctx and ctx.get('manual',False)) and 'manual' or 'base',
'state_id': lambda obj, cursor, user, context: obj._default_value(
cursor, user, 'state_id', context=context),
}
-
+
def fields_get(self, cr, uid, fields=None, context=None):
res = super(res_partner_bank, self).fields_get(cr, uid, fields, context)
bank_type_obj = self.pool.get('res.partner.bank.type')
'email': fields.function(_get_address_data, fnct_inv=_set_address_data, size=64, type='char', string="Email", multi='address'),
'phone': fields.function(_get_address_data, fnct_inv=_set_address_data, size=64, type='char', string="Phone", multi='address'),
}
+ _sql_constraints = [
+ ('com_name_uniq', 'unique (name)', 'The company name must be unique !')
+ ]
def _search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False, access_rights_uid=None):
'active': lambda *a: 1,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'res.currency', context=c)
}
+ _sql_constraints = [
+ ('currency_name_uniq', 'unique (name, company_id)', 'The currency code must be unique !'),
+ ]
_order = "name"
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'):