'code': fields.char('Code', size=8),
'active': fields.boolean('Active', help="If the active field is set to "\
"true, it will allow you to hide the sales team without removing it."),
- 'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"),
'change_responsible': fields.boolean('Reassign Escalated', help="When escalating to this team override the salesman with the team leader."),
'user_id': fields.many2one('res.users', 'Team Leader'),
'member_ids':fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'),
_defaults = {
'active': 1,
- 'allow_unlink': 1,
'stage_ids': _get_stage_common,
'alias_domain': False, # always hide alias during creation
}
def _find_object_id(self, cr, uid, context=None):
"""Finds id for case object"""
- object_id = context and context.get('object_id', False) or False
- ids = self.pool.get('ir.model').search(cr, uid, [('id', '=', object_id)])
+ context = context or {}
+ object_id = context.get('object_id', False)
+ ids = self.pool.get('ir.model').search(cr, uid, ['|',('id', '=', object_id),('model', '=', context.get('object_name', False))])
return ids and ids[0] or False
_defaults = {