[FIX] hr_timesheet_invoice: Passed to_invocie while creating of analytic lines

lp bug: https://launchpad.net/bugs/734497 fixed

bzr revid: pso@tinyerp.com-20110407053642-ao3itgzmfg94oboy
This commit is contained in:
Kervel,PSO 2011-04-07 11:06:42 +05:30 committed by pso (OpenERP)
parent ffee41cbed
commit 05e833ccfa
1 changed files with 15 additions and 0 deletions

View File

@ -176,5 +176,20 @@ class account_invoice(osv.osv):
account_invoice()
class account_move_line(osv.osv):
_inherit = "account.move.line"
def create_analytic_lines(self, cr, uid, ids, context=None):
res = super(account_move_line, self).create_analytic_lines(cr, uid, ids,context=context)
analytic_line_obj = self.pool.get('account.analytic.line')
for move_line in self.pool.get('account.move.line').browse(cr, uid, ids, context=context):
for line in move_line.analytic_lines:
toinv = line.account_id.to_invoice.id
if toinv:
analytic_line_obj.write(cr, uid, line.id, {'to_invoice': toinv})
return res
account_move_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: