I've already create a custom module and use inheritance successfully.
I add to my personal module a piece of code to fix a bug but this code is don't read by openERP.
class calendar_event(osv.osv):
_name = 'calendar.event'
_inherit = 'calendar.event'
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
_logger.debug('"""""""""""""""""""""XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX""""""""""""""""""""')
if context is None:
context = {}
fields2 = fields and fields[:] or None
EXTRAFIELDS = ('class','user_id','duration')
for f in EXTRAFIELDS:
if fields and (f not in fields):
fields2.append(f)
# FIXME This whole id mangling has to go!
if isinstance(ids, (str, int, long)):
select = [ids]
else:
select = ids
select = map(lambda x: (x, base_calendar_id2real_id(x)), select)
result = []
real_data = super(calendar_event, self).read(cr, uid,
[real_id for base_calendar_id, real_id in select],
fields=fields2, context=context, load=load)
real_data = dict(zip([x['id'] for x in real_data], real_data))
for base_calendar_id, real_id in select:
res = real_data[real_id].copy()
ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0)
if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
res['date'] = ls[1]
res['date_deadline'] = ls[2]
res['id'] = base_calendar_id
result.append(res)
for r in result:
if r['user_id']:
user_id = type(r['user_id']) in (tuple,list) and r['user_id'][0] or r['user_id']
if user_id==uid:
continue
if r['class']=='private':
for f in r.keys():
if f not in ('id','date','date_deadline','duration','user_id','state','interval','count'):
if isinstance(r[f], list):
r[f] = []
else:
r[f] = False
if f=='name':
r[f] = _('Busy')
for r in result:
for k in EXTRAFIELDS:
if (k in r) and (fields and (k not in fields)):
del r[k]
if isinstance(ids, (str, int, long)):
return result and result[0] or False
return result
When I use this method I don't see this text in log file : _logger.debug('"""""""""""""""""""""XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX""""""""""""""""""""')
I modify the function like here:https://code.launchpad.net/~openerp-dev/openobject-addons/7.0-opw-586451-pna/+merge/149266