[FIX]: Fix default user timesheetline problem
bzr revid: atp@tinyerp.com-20121011123441-5zg1nm394d0b45ky
This commit is contained in:
parent
b27b12db1b
commit
de0023a14f
|
@ -136,7 +136,7 @@ class hr_analytic_timesheet(osv.osv):
|
|||
emp_obj = self.pool.get('hr.employee')
|
||||
if context is None:
|
||||
context = {}
|
||||
emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context)
|
||||
emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', False) or uid)], context=context)
|
||||
if not emp_id :
|
||||
raise osv.except_osv(_('Warning!'), _('Please create an employee for this user, using the menu: Human Resources > Employees.'))
|
||||
emp = emp_obj.browse(cr, uid, emp_id[0], context=context)
|
||||
|
@ -152,7 +152,7 @@ class hr_analytic_timesheet(osv.osv):
|
|||
'general_account_id': _getGeneralAccount,
|
||||
'journal_id': _getAnalyticJournal,
|
||||
'date': lambda self, cr, uid, ctx: ctx.get('date', fields.date.context_today(self,cr,uid,context=ctx)),
|
||||
'user_id': lambda obj, cr, uid, ctx: ctx.get('user_id', uid),
|
||||
'user_id': lambda obj, cr, uid, ctx: ctx.get('user_id', False) or uid,
|
||||
}
|
||||
def on_change_account_id(self, cr, uid, ids, account_id, user_id):
|
||||
return {'value':{}}
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
|
||||
<field invisible="1" name="amount"/>
|
||||
<field invisible="1" name="general_account_id"/>
|
||||
<field invisible="1" name="user_id" required="1"/>
|
||||
<field name="user_id" required="1" />
|
||||
</tree>
|
||||
<form string="Timesheet Lines" version="7.0">
|
||||
<field name="date"/>
|
||||
|
|
Loading…
Reference in New Issue