Merge lp:~numerigraphe/openobject-addons/6.0-account-invoice-skip-draft into lp:openobject-addons/6.0

Proposed by Numérigraphe
Status: Needs review
Proposed branch: lp:~numerigraphe/openobject-addons/6.0-account-invoice-skip-draft
Merge into: lp:openobject-addons/6.0
Diff against target: 21 lines (+5/-4)
1 file modified
account/invoice.py (+5/-4)
To merge this branch: bzr merge lp:~numerigraphe/openobject-addons/6.0-account-invoice-skip-draft
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+168086@code.launchpad.net

Description of the change

To post a comment you must log in.

Unmerged revisions

5478. By Somesh Khare(OpenERP)

[FIX] backport fix:account: when you set "Skip 'Draft' State for Manual Entries" on sale journal, invoices allow gap in numbering

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/invoice.py'
2--- account/invoice.py 2012-08-20 15:53:34 +0000
3+++ account/invoice.py 2013-06-07 14:36:19 +0000
4@@ -936,13 +936,14 @@
5 for i in line:
6 i[2]['period_id'] = period_id
7
8- move_id = self.pool.get('account.move').create(cr, uid, move, context=context)
9- new_move_name = self.pool.get('account.move').browse(cr, uid, move_id).name
10+ ctx.update(invoice=inv)
11+ move_id = self.pool.get('account.move').create(cr, uid, move, context=ctx)
12+ new_move_name = self.pool.get('account.move').browse(cr, uid, move_id, context=ctx).name
13 # make the invoice point to that move
14- self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name})
15+ self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx)
16 # Pass invoice in context in method post: used if you want to get the same
17 # account move reference when creating the same invoice after a cancelled one:
18- self.pool.get('account.move').post(cr, uid, [move_id], context={'invoice':inv})
19+ self.pool.get('account.move').post(cr, uid, [move_id], context=ctx)
20 self._log_event(cr, uid, ids)
21 return True
22