Merge lp:~openerp-dev/openobject-addons/trunk-opw-573448-port-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Merged
Merged at revision: 8331
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-573448-port-mma
Merge into: lp:openobject-addons
Diff against target: 20 lines (+6/-3)
1 file modified
hr_timesheet_invoice/hr_timesheet_invoice.py (+6/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-573448-port-mma
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+136640@code.launchpad.net

Description of the change

Hello,

   I Have fix the issue of Create the invoice again and again
   More information and reproduce this issue go on lp:948876

   Code is forward port from 6.1

Thanks,
Mayur

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py'
2--- hr_timesheet_invoice/hr_timesheet_invoice.py 2012-11-28 11:40:02 +0000
3+++ hr_timesheet_invoice/hr_timesheet_invoice.py 2012-11-28 12:35:28 +0000
4@@ -368,10 +368,13 @@
5 res = super(account_move_line, self).create_analytic_lines(cr, uid, ids,context=context)
6 analytic_line_obj = self.pool.get('account.analytic.line')
7 for move_line in self.browse(cr, uid, ids, context=context):
8+ #For customer invoice, link analytic line to the invoice so it is not proposed for invoicing in Bill Tasks Work
9+ invoice_id = move_line.invoice and move_line.invoice.type in ('out_invoice','out_refund') and move_line.invoice.id or False
10 for line in move_line.analytic_lines:
11- toinv = line.account_id.to_invoice.id
12- if toinv:
13- analytic_line_obj.write(cr, uid, line.id, {'to_invoice': toinv})
14+ analytic_line_obj.write(cr, uid, line.id, {
15+ 'invoice_id': invoice_id,
16+ 'to_invoice': line.account_id.to_invoice and line.account_id.to_invoice.id or False
17+ }, context=context)
18 return res
19
20 account_move_line()

Subscribers

People subscribed via source and target branches

to all changes: