Files
odoo_source/addons
althaf shaik 29097e10d8 [FIX] account: restrict to create payment without payment date
This traceback raises when user tries to create payment without payment date.

To reproduce this issue:

1) Install 'account'
2) Open any existing invoice (not a DRAFT one)
3) Click 'REGISTER PAYMENT' button.
4) Now remove 'Payment Date'

Error: 'Expected singleton: account.payment.term()'

Note:- 'TypeError: unsupported operand type(s) for +=: 'float' and 'NoneType''
is also produced for some invoices.

When user removes 'payment_date' '_compute_amount' method will be called, In which
'_get_total_amount_in_wizard_currency_to_full_reconcile' method is used.

In '_get_total_amount_in_wizard_currency_to_full_reconcile' method,
'_get_total_amount_using_same_currency' is used to get total amount.

On '_get_total_amount_using_same_currency' method payment_date is passed as an
argument for '_is_eligible_for_early_payment_discount' method.

See: https://github.com/odoo/odoo/blob/ed2e26633458f1284437286f71eba43c8d1818a7/addons/account/wizard/account_payment_register.py#L490-L498

On '_is_eligible_for_early_payment_discount' method if no reference date,
its returning True. which leads to above traceback
See:
https://github.com/odoo/odoo/blob/ed2e26633458f1284437286f71eba43c8d1818a7/addons/account/models/account_move.py#L1902-L1905

sentry-4337953422

closes odoo/odoo#134721

X-original-commit: a05be50b9cf75fb0226f7b464b3a8f580465d462
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-08 13:45:34 +00:00
..
2023-08-23 21:07:54 +02:00
2023-09-06 16:19:51 +00:00
2023-09-08 08:29:53 +00:00
2023-08-18 19:17:16 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-09-06 11:51:00 +00:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-17 18:42:46 +02:00
2023-08-01 13:51:17 +02:00