[FIX] Bug 361540 : Analytic_journal_billing rate and project_timesheet corrected

bzr revid: jvo@tinyerp.com-20090415140332-4tz8hs11s1tmt08s
This commit is contained in:
Jay (Open ERP)
2009-04-15 19:33:32 +05:30
parent ab164fe022
commit 7b496b57b5
2 changed files with 5 additions and 6 deletions
@@ -48,7 +48,7 @@ class hr_analytic_timesheet(osv.osv):
_inherit = "hr.analytic.timesheet"
def on_change_account_id(self, cr, uid, ids, user_id, account_id, unit_amount=0, journal_id=0):
def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0, journal_id=0):
res = {}
if not (account_id):
#avoid a useless call to super
@@ -62,7 +62,7 @@ class hr_analytic_timesheet(osv.osv):
if not temp:
#if there isn't any record for this journal_id and account_id
return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids,account_id,user_id, unit_amount)
return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids,account_id,user_id, unit_amount)
else:
#get the old values from super and add the value from the new relation analytic_journal_rate_grid
r = self.pool.get('analytic_journal_rate_grid').browse(cr, uid, temp)[0]
@@ -59,9 +59,9 @@ class project_work(osv.osv):
vals_line['user_id'] = vals['user_id']
vals_line['date'] = vals['date'][:10]
vals_line['unit_amount'] = vals['hours']
vals_line['account_id'] = obj_task.project_id.category_id.id
res = obj.on_change_account_id(cr, uid, False, obj_task.project_id.category_id.id)
print 'Got', res
acc_id = obj_task.project_id.category_id.id
vals_line['account_id'] = acc_id
res = obj.on_change_account_id(cr, uid, False, acc_id)
if res.get('value'):
vals_line.update(res['value'])
vals_line['general_account_id'] = a
@@ -109,7 +109,6 @@ class project_work(osv.osv):
'hr_analytic_timesheet_id':fields.integer('Related Timeline Id')
}
project_work()
class project_project(osv.osv):