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
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2013-06-12 15:38:14 +0000
+++ account/account_invoice.py 2013-07-15 16:40:38 +0000
@@ -560,10 +560,14 @@
560560
561 def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):561 def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):
562 res = {}562 res = {}
563 if isinstance(ids, (int, long)):
564 ids = [ids]
563 if not date_invoice:565 if not date_invoice:
564 date_invoice = time.strftime('%Y-%m-%d')566 date_invoice = time.strftime('%Y-%m-%d')
565 if not payment_term_id:567 if not payment_term_id:
566 return {'value':{'date_due': date_invoice}} #To make sure the invoice has a due date when no payment term568 inv = self.browse(cr, uid, ids[0])
569 #To make sure the invoice due date should contain due date which is entered by user when there is no payment term defined
570 return {'value':{'date_due': inv.date_due and inv.date_due or date_invoice}}
567 pterm_list = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)571 pterm_list = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
568 if pterm_list:572 if pterm_list:
569 pterm_list = [line[0] for line in pterm_list]573 pterm_list = [line[0] for line in pterm_list]

Subscribers

People subscribed via source and target branches

to all changes: