Merge lp:~openerp-dev/openobject-addons/7.0-opw-595641-rha into lp:openobject-addons/7.0

Proposed by Rifakat Husen (OpenERP)
Status: Rejected
Rejected by: Martin Trigaux (OpenERP)
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-595641-rha
Merge into: lp:openobject-addons/7.0
Diff against target: 14 lines (+2/-2)
1 file modified
stock_invoice_directly/wizard/stock_invoice.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-595641-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+177319@code.launchpad.net

Description of the change

Enabled warehouse configuration option, "Create and open the invoice when the user finish a delivery order"(module stock_invoice_directly).

Parially processesing the delivery order does automatically invoice the wrong delivery order. It should invoice processed delivery(Backorder) but instead it invoice the delivery which is yet to be processed.

Steps:
- Enable above option
- Create sales order for any product with 3 qty with invoice policy based "On Delivery Order"
- Confirm sales and open delivery order, and process delivery for 2 qty
- It will open an invoice wizard, and create invoice
- It creates invoice for remaining delivery of qty 1 instead of the Backorder of qty 2.

Problem:
Partial delivery keeps open window/form of main/remin delivery that's the reason it's active_id is used to create invoice, but it should actually consider backorder_id.

Fix:
Passed backorder_id as active_id so it will be invoiced.

To post a comment you must log in.
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

As mentioned on the bug report there were some cases not handled properly.
Instead I have made similar patch but also testing the state of the picking as well. This was merged in 7.0 at revision 9540.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock_invoice_directly/wizard/stock_invoice.py'
2--- stock_invoice_directly/wizard/stock_invoice.py 2012-12-06 14:56:32 +0000
3+++ stock_invoice_directly/wizard/stock_invoice.py 2013-07-29 06:53:27 +0000
4@@ -32,8 +32,8 @@
5 result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
6 partial = self.browse(cr, uid, ids[0], context)
7 context.update(active_model='stock.picking',
8- active_ids=[partial.picking_id.id])
9- if partial.picking_id.invoice_state == '2binvoiced':
10+ active_ids=[partial.picking_id.backorder_id.id])
11+ if partial.picking_id.backorder_id.invoice_state == '2binvoiced':
12 return {
13 'name': 'Create Invoice',
14 'view_type': 'form',