[FIX] Signature on overriden fields_get method

This commit is contained in:
FalcoBolger 2015-03-02 13:36:52 +01:00 committed by Martin Trigaux
parent c3f4ec856c
commit 714fe9135d
4 changed files with 8 additions and 8 deletions

View File

@ -397,8 +397,8 @@ class payment_line(osv.osv):
break break
return {'value': data} return {'value': data}
def fields_get(self, cr, uid, fields=None, context=None): def fields_get(self, cr, uid, fields=None, context=None, write_access=True, attributes=None):
res = super(payment_line, self).fields_get(cr, uid, fields, context) res = super(payment_line, self).fields_get(cr, uid, fields, context, write_access, attributes)
if 'communication2' in res: if 'communication2' in res:
res['communication2'].setdefault('states', {}) res['communication2'].setdefault('states', {})
res['communication2']['states']['structured'] = [('readonly', True)] res['communication2']['states']['structured'] = [('readonly', True)]

View File

@ -151,8 +151,8 @@ class res_partner_bank(osv.osv):
'name': '/' 'name': '/'
} }
def fields_get(self, cr, uid, allfields=None, context=None): def fields_get(self, cr, uid, allfields=None, context=None, write_access=True, attributes=None):
res = super(res_partner_bank, self).fields_get(cr, uid, allfields=allfields, context=context) res = super(res_partner_bank, self).fields_get(cr, uid, allfields=allfields, context=context, write_access=write_access, attributes=attributes)
bank_type_obj = self.pool.get('res.partner.bank.type') bank_type_obj = self.pool.get('res.partner.bank.type')
type_ids = bank_type_obj.search(cr, uid, []) type_ids = bank_type_obj.search(cr, uid, [])
types = bank_type_obj.browse(cr, uid, type_ids) types = bank_type_obj.browse(cr, uid, type_ids)

View File

@ -362,13 +362,13 @@ class res_config_installer(osv.osv_memory, res_config_module_installation_mixin)
self.already_installed(cr, uid, context=context), self.already_installed(cr, uid, context=context),
True)) True))
def fields_get(self, cr, uid, fields=None, context=None, write_access=True): def fields_get(self, cr, uid, fields=None, context=None, write_access=True, attributes=None):
""" If an addon is already installed, set it to readonly as """ If an addon is already installed, set it to readonly as
res.config.installer doesn't handle uninstallations of already res.config.installer doesn't handle uninstallations of already
installed addons installed addons
""" """
fields = super(res_config_installer, self).fields_get( fields = super(res_config_installer, self).fields_get(
cr, uid, fields, context, write_access) cr, uid, fields, context, write_access, attributes)
for name in self.already_installed(cr, uid, context=context): for name in self.already_installed(cr, uid, context=context):
if name not in fields: if name not in fields:

View File

@ -890,8 +890,8 @@ class users_view(osv.osv):
selected = [gid for gid in get_selection_groups(f) if gid in gids] selected = [gid for gid in get_selection_groups(f) if gid in gids]
values[f] = selected and selected[-1] or False values[f] = selected and selected[-1] or False
def fields_get(self, cr, uid, allfields=None, context=None, write_access=True): def fields_get(self, cr, uid, allfields=None, context=None, write_access=True, attributes=None):
res = super(users_view, self).fields_get(cr, uid, allfields, context, write_access) res = super(users_view, self).fields_get(cr, uid, allfields, context, write_access, attributes)
# add reified groups fields # add reified groups fields
for app, kind, gs in self.pool['res.groups'].get_groups_by_application(cr, uid, context): for app, kind, gs in self.pool['res.groups'].get_groups_by_application(cr, uid, context):
if kind == 'selection': if kind == 'selection':