[REF]account,hr_timesheet,product,point_of_sale,project:isinstance remove
bzr revid: ron@tinyerp.com-20110301124841-5fc80dgsnwm76590
This commit is contained in:
parent
7b2c1d2855
commit
de02305285
|
@ -45,8 +45,7 @@ class account_crossovered_analytic(osv.osv_memory):
|
||||||
acc_ids = [x[0] for x in res]
|
acc_ids = [x[0] for x in res]
|
||||||
|
|
||||||
data = self.read(cr, uid, ids, [], context=context)[0]
|
data = self.read(cr, uid, ids, [], context=context)[0]
|
||||||
if isinstance(data['ref'],tuple):
|
data['ref'] = data['ref'][0]
|
||||||
data['ref'] = data['ref'][0]
|
|
||||||
|
|
||||||
obj_acc = self.pool.get('account.analytic.account').browse(cr, uid, data['ref'], context=context)
|
obj_acc = self.pool.get('account.analytic.account').browse(cr, uid, data['ref'], context=context)
|
||||||
name = obj_acc.name
|
name = obj_acc.name
|
||||||
|
|
|
@ -37,9 +37,7 @@ class account_invoice_with_message(report_sxw.rml_parse):
|
||||||
self.context = context
|
self.context = context
|
||||||
|
|
||||||
def spcl_msg(self, form):
|
def spcl_msg(self, form):
|
||||||
msg_id = form['message']
|
msg_id = form['message'][0]
|
||||||
if isinstance(msg_id, (tuple,list)):
|
|
||||||
msg_id = msg_id[0]
|
|
||||||
account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, msg_id)
|
account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, msg_id)
|
||||||
msg = account_msg_data.msg
|
msg = account_msg_data.msg
|
||||||
return msg
|
return msg
|
||||||
|
|
|
@ -50,8 +50,7 @@ class analytical_timesheet_employee(osv.osv_memory):
|
||||||
|
|
||||||
def print_report(self, cr, uid, ids, context=None):
|
def print_report(self, cr, uid, ids, context=None):
|
||||||
data = self.read(cr, uid, ids, context=context)[0]
|
data = self.read(cr, uid, ids, context=context)[0]
|
||||||
if isinstance(data['employee_id'], tuple):
|
data['employee_id'] = data['employee_id'][0]
|
||||||
data['employee_id'] = data['employee_id'][0]
|
|
||||||
datas = {
|
datas = {
|
||||||
'ids': [],
|
'ids': [],
|
||||||
'model': 'hr.employee',
|
'model': 'hr.employee',
|
||||||
|
|
|
@ -149,8 +149,7 @@ class pos_make_payment(osv.osv_memory):
|
||||||
amount = order.amount_total - order.amount_paid
|
amount = order.amount_total - order.amount_paid
|
||||||
data = self.read(cr, uid, ids, context=context)[0]
|
data = self.read(cr, uid, ids, context=context)[0]
|
||||||
for m2o_field in ['product_id','pricelist_id','partner_id']:
|
for m2o_field in ['product_id','pricelist_id','partner_id']:
|
||||||
if data[m2o_field] and isinstance(data[m2o_field], (list,tuple)):
|
data[m2o_field] = data[m2o_field][0]
|
||||||
data[m2o_field] = data[m2o_field][0]
|
|
||||||
if data['is_acc']:
|
if data['is_acc']:
|
||||||
amount = self.pool.get('product.product').browse(cr, uid, data['product_id'], context=context).list_price
|
amount = self.pool.get('product.product').browse(cr, uid, data['product_id'], context=context).list_price
|
||||||
|
|
||||||
|
|
|
@ -53,8 +53,7 @@ class product_price_list(osv.osv_memory):
|
||||||
datas = {'ids': context.get('active_ids', [])}
|
datas = {'ids': context.get('active_ids', [])}
|
||||||
res = self.read(cr, uid, ids, ['price_list','qty1', 'qty2','qty3','qty4','qty5'], context=context)
|
res = self.read(cr, uid, ids, ['price_list','qty1', 'qty2','qty3','qty4','qty5'], context=context)
|
||||||
res = res and res[0] or {}
|
res = res and res[0] or {}
|
||||||
if isinstance(res['price_list'], (tuple,list)):
|
res['price_list'] = res['price_list'][0]
|
||||||
res['price_list'] = res['price_list'][0]
|
|
||||||
datas['form'] = res
|
datas['form'] = res
|
||||||
return {
|
return {
|
||||||
'type': 'ir.actions.report.xml',
|
'type': 'ir.actions.report.xml',
|
||||||
|
|
|
@ -105,8 +105,7 @@ class project_task_delegate(osv.osv_memory):
|
||||||
task_id = context.get('active_id', False)
|
task_id = context.get('active_id', False)
|
||||||
task_pool = self.pool.get('project.task')
|
task_pool = self.pool.get('project.task')
|
||||||
delegate_data = self.read(cr, uid, ids, context=context)[0]
|
delegate_data = self.read(cr, uid, ids, context=context)[0]
|
||||||
if isinstance(delegate_data['user_id'], tuple):
|
delegate_data['user_id'] = delegate_data['user_id'][0]
|
||||||
delegate_data['user_id'] = delegate_data['user_id'][0]
|
|
||||||
delegate_data['name'] = tools.ustr(delegate_data['name'])
|
delegate_data['name'] = tools.ustr(delegate_data['name'])
|
||||||
task_pool.do_delegate(cr, uid, task_id, delegate_data, context=context)
|
task_pool.do_delegate(cr, uid, task_id, delegate_data, context=context)
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -35,8 +35,7 @@ class backlog_create_task(osv.osv_memory):
|
||||||
ids_task = []
|
ids_task = []
|
||||||
|
|
||||||
data = self.read(cr, uid, ids, [], context=context)[0]
|
data = self.read(cr, uid, ids, [], context=context)[0]
|
||||||
if isinstance(data['user_id'], tuple):
|
data['user_id'] = data['user_id'][0]
|
||||||
data['user_id'] = data['user_id'][0]
|
|
||||||
|
|
||||||
backlogs = backlog_id.browse(cr, uid, context['active_ids'], context=context)
|
backlogs = backlog_id.browse(cr, uid, context['active_ids'], context=context)
|
||||||
result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form')
|
result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form')
|
||||||
|
|
Loading…
Reference in New Issue