Due date on supplier invoice won't be changed If we don't select the payment term

Bug #1102078 reported by Dušan Laznik (Mentis)
56
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3
OpenERP Community Backports (Addons)
Status tracked in 7.0
7.0
Fix Released
Undecided
Unassigned

Bug Description

Open ERP v 7.0 - Accounting - Supplier Invoices

There is now payment term set on supplier or invoice . On draft invoice manually set invoice due date. Save invoice everything OK!
  Validate invoice , due date is changed to invoice date.

Related branches

description: updated
summary: - Due date on supplierinvoice
+ Due date on supplier invoice
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote : Re: Due date on supplier invoice
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Dušan Laznik,

I have checked this issue but its working fine for me. So, Would you please check it again with payment terms or else provide more information about this issue.

Thank you.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Dušan Laznik (Mentis) (laznik) wrote :

Hello Twinkle Christian,

I now that it works , when You select a payment term on invoice.
But in real life it is very common to manually define due date on invoice. So I wont to left payment terms empty and manually enter due date. When validating invoice OpenERP will change my input.
We already made a patch , I can send it to You if You wont , but it fairly easy (just two words).

Best regards !

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Dusan,

Yes, you are correct. We manually enter the due date then it wont be changed If we don't select any payment term.

Thank you!

summary: - Due date on supplier invoice
+ Due date on supplier invoice won't be changed If we don't select the
+ payment term
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: Incomplete → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Chandni Gandhi(OpenERP) (cga-openerp) wrote :

Hello,

It has been fixed in to : https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1102078-cga

Revision No:8522
Revision ID:<email address hidden>

It will be merged soon.

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Chandni Gandhi(OpenERP) (cga-openerp) wrote :

Hello,

I have improve the code as per suggestion.

Revision No:8524
Revision ID:<email address hidden>

Thanks.

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,
I do not think your fix is correct.
Would you mind to check this alternative:
https://code.launchpad.net/~camptocamp/ocb-addons/7.0-fix-bug-1102078

Revision history for this message
Yoshi Tashiro (yostashiro) wrote :

Hi Nicolas,

I tried your code (https://code.launchpad.net/~camptocamp/ocb-addons/7.0-fix-bug-1102078) on my environment (version 7.0-20130420-232354) and find there is issue with following case:

1. Open customer invoice screen by "Create".
2. System by default proposes payment due date based on CURRENT date + payment term
3. Update the invoice date but it doesn't trigger due date update (due to your code)

As a result, the document can be validated with the wrong due date (the value from #2).

I think the behavior of #2 is different to supplier invoice side. (i.e. in supplier invoice, due date doesn't update until you validate the document) So I wonder whether the behavior of #2 should also be updated.

Sorry I am not a programmer and I cannot prepare a code sample quickly.

Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello guys,

Thanks for the report, patches and reviews. I have finally integrated the merge from Amit and Rifakat as there was problem in Nicolas's patch as mentioned Yoshi.
revno: 9314 [merge]
revision-id: <email address hidden>

Regards

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Mario Arias (the-clone-master) wrote :

This fix is incomplete, as onchange_payment_term_date_invoice has an error, that will led to incorrect date_due if the user selects a date_invoice different than current date...

If there is no date_invoice defined, then it should not fill the date_due field...

Sample:
User creates new invoice and selects a partnert with payment_term defined
This produces that onchange_payment_term_date_invoice will set the date_due field to current date + days in selected payment_term.
Then, user sets the date_invoice (not using current date)
As date_due was filled previously (assuming current date as invoice_date inside of onchange_payment_term_date_invoice), then the system will interpret this as a "user defined" date_due and that was not the case...

Correct behavior should be to "never" set date_due while date_invoice is empty...

Regards

Revision history for this message
Davide Corio (enlightx-deactivatedaccount) wrote :

> Correct behavior should be to "never" set date_due while date_invoice is empty...

+1

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.