Merge lp:~openerp-dev/openobject-addons/7.0-opw-600945-msh into lp:openobject-addons/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Approved
Approved by: Vinay Rana (OpenERP)
Approved revision: 9603
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-600945-msh
Merge into: lp:openobject-addons/7.0
Diff against target: 43 lines (+13/-2)
2 files modified
account/account_invoice.py (+11/-0)
account/account_invoice_view.xml (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-600945-msh
Reviewer Review Type Date Requested Status
Vinay Rana (OpenERP) (community) Approve
Martin Trigaux (OpenERP) Pending
Naresh(OpenERP) Pending
Review via email: mp+195902@code.launchpad.net

Description of the change

Hello,

Fixed the issue of due_date in invoice not came according to invoice_date when invoice_date set after selecting partner, if there is already a invoice_date avaialable then onchange_partner_id returns due_date according to invoice_date + payment term days but if partner is selected and then invoice_date changed then due_date not calculated according to invoice_date.

Demo: Go to Customer/Supplier Invoice, select a partner which has payment term set, after selecting partner you will see due date is calculated according to partner's payment term but after that change the Invoice Date, Due Date doesn't changed, select Invoice Date first and then select partner which has payment term set, you will get Due Date with respect of Invoice Date.

on_change_invoice_date method should be there which is called when invoice date changed.

Thanks.

To post a comment you must log in.
9603. By Mohammed Shekha(OpenERP)<email address hidden>

[FIX]]Account: Re-fixed the issue of due_date in invoice not came according to invoice_date when invoice_date set after selecting partner, if there is already a invoice_date avaialable then onchange_partner_id returns due_date according to invoice_date + payment term days but if partner is selected and then invoice_date changed then due_date not calculated according to invoice_date.

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) :
review: Approve

Unmerged revisions

9603. By Mohammed Shekha(OpenERP)<email address hidden>

[FIX]]Account: Re-fixed the issue of due_date in invoice not came according to invoice_date when invoice_date set after selecting partner, if there is already a invoice_date avaialable then onchange_partner_id returns due_date according to invoice_date + payment term days but if partner is selected and then invoice_date changed then due_date not calculated according to invoice_date.

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-09-20 09:50:26 +0000
+++ account/account_invoice.py 2013-11-20 05:33:24 +0000
@@ -558,6 +558,17 @@
558 }558 }
559 return result559 return result
560560
561 def onchange_date_invoice(self, cr, uid, ids, type, partner_id, date_invoice):
562 if not partner_id:
563 return {'value': {}}
564 p = self.pool.get('res.partner').browse(cr, uid, partner_id)
565 if type in ('out_invoice', 'out_refund'):
566 partner_payment_term = p.property_payment_term and p.property_payment_term.id or False
567 else:
568 partner_payment_term = p.property_supplier_payment_term and p.property_supplier_payment_term.id or False
569 return self.onchange_payment_term_date_invoice(
570 cr, uid, ids, partner_payment_term, date_invoice)
571
561 def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):572 def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):
562 res = {}573 res = {}
563 if isinstance(ids, (int, long)):574 if isinstance(ids, (int, long)):
564575
=== modified file 'account/account_invoice_view.xml'
--- account/account_invoice_view.xml 2013-09-20 09:50:26 +0000
+++ account/account_invoice_view.xml 2013-11-20 05:33:24 +0000
@@ -177,7 +177,7 @@
177 </div>177 </div>
178 </group>178 </group>
179 <group>179 <group>
180 <field name="date_invoice"/>180 <field name="date_invoice" on_change="onchange_date_invoice(type, partner_id, date_invoice)"/>
181 <field name="date_due"/>181 <field name="date_due"/>
182 <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"182 <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
183 name="account_id" groups="account.group_account_user"/>183 name="account_id" groups="account.group_account_user"/>
@@ -326,7 +326,7 @@
326 <field name="fiscal_position" widget="selection" />326 <field name="fiscal_position" widget="selection" />
327 </group>327 </group>
328 <group>328 <group>
329 <field name="date_invoice"/>329 <field name="date_invoice" on_change="onchange_date_invoice(type, partner_id, date_invoice)" />
330 <field name="journal_id" groups="account.group_account_user"330 <field name="journal_id" groups="account.group_account_user"
331 on_change="onchange_journal_id(journal_id, context)" widget="selection"/>331 on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
332 <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]"332 <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]"