Merge lp:~rr.clearcorp/openobject-addons/7.0-pending_merge into lp:~clearcorp-drivers/openobject-addons/7.0-ccorp

Proposed by Ronald Rubi
Status: Merged
Merged at revision: 9281
Proposed branch: lp:~rr.clearcorp/openobject-addons/7.0-pending_merge
Merge into: lp:~clearcorp-drivers/openobject-addons/7.0-ccorp
Diff against target: 19 lines (+5/-1)
1 file modified
account/account_invoice.py (+5/-1)
To merge this branch: bzr merge lp:~rr.clearcorp/openobject-addons/7.0-pending_merge
Reviewer Review Type Date Requested Status
ClearCorp drivers Pending
Review via email: mp+174819@code.launchpad.net

Description of the change

[FIX] Merge patch opw_594956_due_date.patch, account_invoice: due date is reset to current date when we have no payment term and due date is manually defined

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_invoice.py'
2--- account/account_invoice.py 2013-06-12 15:38:14 +0000
3+++ account/account_invoice.py 2013-07-15 16:40:38 +0000
4@@ -560,10 +560,14 @@
5
6 def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):
7 res = {}
8+ if isinstance(ids, (int, long)):
9+ ids = [ids]
10 if not date_invoice:
11 date_invoice = time.strftime('%Y-%m-%d')
12 if not payment_term_id:
13- return {'value':{'date_due': date_invoice}} #To make sure the invoice has a due date when no payment term
14+ inv = self.browse(cr, uid, ids[0])
15+ #To make sure the invoice due date should contain due date which is entered by user when there is no payment term defined
16+ return {'value':{'date_due': inv.date_due and inv.date_due or date_invoice}}
17 pterm_list = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
18 if pterm_list:
19 pterm_list = [line[0] for line in pterm_list]

Subscribers

People subscribed via source and target branches

to all changes: