From 511a87b488d20fb7a085ce68bc966a359d2a8a4b Mon Sep 17 00:00:00 2001 From: "Touati Djamel (otd)" Date: Fri, 9 Jul 2021 05:35:35 +0000 Subject: [PATCH] [FIX] account: Fix clearing of the accounting date Steps to reproduce the bug: - Go to Accounting > Vendors > Bills - Create a new Bills - Delete the contents of the 'Accounting Date' field. - Click off that field. Problem: -An AttributeError is triggered because we try to recalculate a new name via the function `"_compute_name"` and we base ourselves on the date field, but we do not check if it is null or not before accessing it. This field is only used for purchase receipts, vendor bills, vendor credit notes, payments and regular journal entries. Other move types are unaffected here. opw-2511799 closes odoo/odoo#73490 X-original-commit: f830efa1af28de4a4cc3b861643ac9b6fb352c8d Signed-off-by: oco-odoo Signed-off-by: Djamel Touati --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 8b196b51587..1b7dc2f6294 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1096,7 +1096,7 @@ class AccountMove(models.Model): # Group the moves by journal and month for move in self: - if not highest_name and move == self[0] and not move.posted_before: + if not highest_name and move == self[0] and not move.posted_before and move.date: # In the form view, we need to compute a default sequence so that the user can edit # it. We only check the first move as an approximation (enough for new in form view) pass