Versions:
---------
- 16.0
Steps to reproduce:
-------------------
- Create a new Purchase Order.
- Set the Vendor to a brand new contact.
- Add a product that would be delivered.
- Confirm the PO, set the Expected delivery date in the past.
- Notice that on_time_rate and on_time_rate_perc are both -1.
- Process the delivery.
- Now on_time_rate is 0 but on_time_rate_perc is -1 still!
Issue:
------
The field OTD is -1 even when On-time delivery is 0
Cause:
------
The issue is happening because if po.on_time_rate == 0 the value
Is set to -1.
Solution:
---------
Modify the condition to ‘po.on_time_rate >= 0’ to handle this case
OPW-3413668
closesodoo/odoo#128584
X-original-commit: 4e3bf2242808435fd13be323af535cc6cc816da3
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Matheus Leal Viana (malv) <malv@odoo.com>