Fix duplicate timesheet line that have been invoiced.
bzr revid: ced-baea5be92ff0e1802e3d49d6547211e389406799
This commit is contained in:
parent
4821748d69
commit
39eabb3cac
|
@ -97,6 +97,14 @@ class account_analytic_line(osv.osv):
|
||||||
'You can not modify an invoiced analytic line!')
|
'You can not modify an invoiced analytic line!')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def copy(self, cursor, user, obj_id, default=None, context=None):
|
||||||
|
if default is None:
|
||||||
|
default = {}
|
||||||
|
default = default.copy()
|
||||||
|
default.update({'invoice_id': False})
|
||||||
|
return super(account_analytic_line, self).copy(cursor, user, obj_id,
|
||||||
|
default, context)
|
||||||
|
|
||||||
account_analytic_line()
|
account_analytic_line()
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,9 +115,19 @@ class hr_analytic_timesheet(osv.osv):
|
||||||
if not account_id:
|
if not account_id:
|
||||||
return res
|
return res
|
||||||
res.setdefault('value',{})
|
res.setdefault('value',{})
|
||||||
st = self.pool.get('account.analytic.account').browse(cr, uid, account_id).to_invoice.id
|
st = self.pool.get('account.analytic.account').browse(cr, uid,
|
||||||
|
account_id).to_invoice.id
|
||||||
res['value']['to_invoice'] = st or False
|
res['value']['to_invoice'] = st or False
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def copy(self, cursor, user, obj_id, default=None, context=None):
|
||||||
|
if default is None:
|
||||||
|
default = {}
|
||||||
|
default = default.copy()
|
||||||
|
default.update({'invoice_id': False})
|
||||||
|
return super(hr_analytic_timesheet, self).copy(cursor, user, obj_id,
|
||||||
|
default, context)
|
||||||
|
|
||||||
hr_analytic_timesheet()
|
hr_analytic_timesheet()
|
||||||
|
|
||||||
class account_invoice(osv.osv):
|
class account_invoice(osv.osv):
|
||||||
|
|
Loading…
Reference in New Issue