_description = 'Analytic Account'
_track = {
'state': {
- 'analytic.mt_account_pending': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'pending',
- 'analytic.mt_account_closed': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'close',
- 'analytic.mt_account_opened': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'open',
+ 'analytic.mt_account_pending': lambda self, cr, uid, obj, ctx=None: obj.state == 'pending',
+ 'analytic.mt_account_closed': lambda self, cr, uid, obj, ctx=None: obj.state == 'close',
+ 'analytic.mt_account_opened': lambda self, cr, uid, obj, ctx=None: obj.state == 'open',
},
}
args=[]
if context is None:
context={}
- if context.get('current_model') == 'project.project':
- project_obj = self.pool.get("account.analytic.account")
- project_ids = project_obj.search(cr, uid, args)
- return self.name_get(cr, uid, project_ids, context=context)
if name:
account_ids = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)
if not account_ids: