Mayur Maheshwari(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-opw-577189-port-mma into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-577189-port-mma/+merge/132896
Hello,
[Fix]: account_invoice: when you set option Skip Draft State for Manual Entries
on sale journal invoice sequence number incremented
Steps to reproduce:
1 - Install account_cancel module
2 - Set "Skip 'Draft' State for Manual Entries" on sales journal
3 - Create a new invoice and validate it (eg:invoice number 'SAJ/2012/0001')
4 - Cancel the invoice and validate it again
Get 'SAJ/2012/0002' as invoice number
This branch fixes this issue.
Code is forward port from 6.1
Thanks
Mayur
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-577189-port-mma/+merge/132896
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-opw-577189-port-mma.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2012-11-02 09:21:06 +0000
+++ account/account_invoice.py 2012-11-05 13:32:29 +0000
@@ -983,13 +983,13 @@
for i in line:
i[2]['period_id'] = period_id
+ ctx.update(invoice=inv)
move_id = move_obj.create(cr, uid, move, context=ctx)
new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).name
# make the invoice point to that move
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx)
# Pass invoice in context in method post: used if you want to get the same
# account move reference when creating the same invoice after a cancelled one:
- ctx.update({'invoice':inv})
move_obj.post(cr, uid, [move_id], context=ctx)
self._log_event(cr, uid, ids)
return True
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp