Merge lp:~openerp-dev/openobject-addons/7.0-opw-606535-pna into lp:openobject-addons/7.0

Proposed by Pinakin Nayi (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-606535-pna
Merge into: lp:openobject-addons/7.0
Diff against target: 18 lines (+1/-1)
1 file modified
stock/stock.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-606535-pna
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+216675@code.launchpad.net

Description of the change

Hello Sir,

I fixed issue regarding Group invoice creation from the stock_picking_out tree view can use incorrect data.

Steps :
Go to Delivery Orders tree view (stock_picking_out)
  - Select three delivery orders (the sequence below is important)
       Delivery Order 1 with Customer A
       Delivery Order 2 with Customer B
       Delivery Order 3 with Customer A

  - Select “More dropdown” then Create Draft Invoices
       Check “Group by Partner” in popup window
       Select “Create”

PROBLEM: the invoice_vals argument is not re-evaluated when group = True, so invoice_vals still has the information from the previous picking record

Thanks,
pna

To post a comment you must log in.

Unmerged revisions

9998. By Pinakin Nayi (OpenERP)

[FIX]stock: Group invoice creation from the stock_picking_out tree view can use incorrect data

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2014-04-15 16:03:31 +0000
3+++ stock/stock.py 2014-04-22 08:43:36 +0000
4@@ -1137,13 +1137,13 @@
5 if not inv_type:
6 inv_type = self._get_invoice_type(picking)
7
8+ invoice_vals = self._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context)
9 if group and partner.id in invoices_group:
10 invoice_id = invoices_group[partner.id]
11 invoice = invoice_obj.browse(cr, uid, invoice_id)
12 invoice_vals_group = self._prepare_invoice_group(cr, uid, picking, partner, invoice, context=context)
13 invoice_obj.write(cr, uid, [invoice_id], invoice_vals_group, context=context)
14 else:
15- invoice_vals = self._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context)
16 invoice_id = invoice_obj.create(cr, uid, invoice_vals, context=context)
17 invoices_group[partner.id] = invoice_id
18 res[picking.id] = invoice_id