Merge lp:~openerp-dev/openobject-addons/6.1-opw-579389-nep into lp:openobject-addons/6.1

Proposed by Nehal Panchal (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 7004
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579389-nep
Merge into: lp:openobject-addons/6.1
Diff against target: 25 lines (+5/-2)
1 file modified
sale/sale.py (+5/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579389-nep
Reviewer Review Type Date Requested Status
Nehal Panchal (OpenERP) (community) Needs Resubmitting
Naresh(OpenERP) (community) Needs Fixing
Review via email: mp+126430@code.launchpad.net

Description of the change

Hello,

Invoice date of Create Invoices wizard is not considered while creating invoices.

Steps to reproduce:
1. Create Sales Order and confirm it.
2. Create Invoices through wizard and provide the Invoice date.

Provided date will not be shown in generated invoice.

This fixes the issue.

Thanks

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

 - return i.id
18 + if context:
19 + invoice.write(cr, uid, [i.id], {'date_invoice': context['date_inv']})
20 + continue

your code will break if there is no date_invoice key in the context.
The check should be for date exist in context i.e context.has_key(date_inv) if there is no date then its useless to call a write here. also use context.get(date_inv) to get the value.

Thanks,
Naresh

review: Needs Fixing
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

corrections:-

date_invoice should be read as date_inv ;)

Revision history for this message
Nehal Panchal (OpenERP) (nep-openerp) wrote :

Hello Sir,

I have done the changes as per your suggestion.

Thanks

review: Needs Resubmitting
7004. By Nehal Panchal (OpenERP)

[FIX] sale : Invoice date of Create Invoices wizard is not considered while creating invoices

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-579389-port-mma/+merge/136633 and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

7004. By Nehal Panchal (OpenERP)

[FIX] sale : Invoice date of Create Invoices wizard is not considered while creating invoices

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/sale.py'
2--- sale/sale.py 2012-08-28 09:29:46 +0000
3+++ sale/sale.py 2012-09-26 13:20:29 +0000
4@@ -437,7 +437,7 @@
5 'comment': order.note,
6 'payment_term': order.payment_term and order.payment_term.id or False,
7 'fiscal_position': order.fiscal_position.id or order.partner_id.property_account_position.id,
8- 'date_invoice': context.get('date_invoice', False),
9+ 'date_invoice': context.get('date_inv', False),
10 'company_id': order.company_id.id,
11 'user_id': order.user_id and order.user_id.id or False
12 }
13@@ -536,8 +536,11 @@
14 if not invoices:
15 for o in self.browse(cr, uid, ids, context=context):
16 for i in o.invoice_ids:
17+ date_inv = context.get('date_inv', False)
18 if i.state == 'draft':
19- return i.id
20+ if date_inv:
21+ invoice.write(cr, uid, [i.id], {'date_invoice': date_inv})
22+ continue
23 for val in invoices.values():
24 if grouped:
25 res = self._make_invoice(cr, uid, val[0][0], reduce(lambda x, y: x + y, [l for o, l in val], []), context=context)