Merge lp:~openerp-dev/openobject-addons/6.0-opw-575053-rha into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-575053-rha
Merge into: lp:openobject-addons/6.0
Diff against target: 25 lines (+6/-2)
1 file modified
sale/stock.py (+6/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-575053-rha
Reviewer Review Type Date Requested Status
Rifakat Husen (OpenERP) Pending
Naresh(OpenERP) Pending
Review via email: mp+111219@code.launchpad.net

This proposal supersedes a proposal from 2012-05-24.

Description of the change

Hello,

Corrected Invoice name when we create grouped invoice by 'Create Invoice' wizard on Delivery Order list view.

When we provide Customer ref in sales orders then invoice name should be,
ref: order name, ref: order name, ...

Invoice name should contain information of all the customer refs(if defined on sales order) and orders name
from where that invoice is created.

Thanks for the review,

Regards,
Rifakat Haradwala

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote : Posted in a previous version of this proposal

seems ok but the *or* part in your code will never be evaluated because '' +',' = ','.

(inv_names[invoice_created.id] + ', ' or '') + (picking.sale_id.client_order_ref and picking.sale_id.client_order_ref + ' : ' or '') + picking.name

  inv_names[invoice_created.id] = (picking.sale_id.client_order_ref and picking.sale_id.client_order_ref + ' : ' or '') + picking.name

review: Needs Fixing
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote : Posted in a previous version of this proposal

Hello,

I have removed OR part, it will never be excuted because we will always have value
in inv_names[invoice_created.id], in case sale ref is not provided then also delivey
order name will be passed into inv_names[invoice_created.id].

Please have a look at this.
Thanks for your review,
Rifakat Haradwala

review: Needs Resubmitting

Unmerged revisions

5250. By Rifakat Husen (OpenERP)

[IMP] sale: removed or condition check as that would never be executed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/stock.py'
2--- sale/stock.py 2012-03-26 11:12:22 +0000
3+++ sale/stock.py 2012-06-20 13:02:20 +0000
4@@ -128,6 +128,7 @@
5 context=context):
6 invoices[invoice.id] = invoice
7
8+ inv_names = {}
9 for picking in picking_obj.browse(cursor, user, picking_ids,
10 context=context):
11 if not picking.sale_id:
12@@ -137,8 +138,11 @@
13 vals = {'user_id': picking.sale_id.user_id and picking.sale_id.user_id.id or False}
14 if not invoice_created.fiscal_position:
15 vals.update({'fiscal_position': picking.sale_id.fiscal_position and picking.sale_id.fiscal_position.id or False})
16- if picking.sale_id.client_order_ref:
17- vals.update({'name': picking.sale_id.client_order_ref + " : " + invoice_created.name})
18+ if invoice_created.id in inv_names:
19+ inv_names[invoice_created.id] = (inv_names[invoice_created.id] + ', ') + (picking.sale_id.client_order_ref and picking.sale_id.client_order_ref + ' : ' or '') + picking.name
20+ else:
21+ inv_names[invoice_created.id] = (picking.sale_id.client_order_ref and picking.sale_id.client_order_ref + ' : ' or '') + picking.name
22+ vals.update({'name': inv_names[invoice_created.id]})
23 invoice_obj.write(cursor, user, [invoice_created.id], vals, context=context)
24 for sale_line in sale_lines:
25 if sale_line.product_id.type == 'service' and sale_line.invoiced == False: