From d07f540e30f087f02a061c2adca8d7678bb30dd0 Mon Sep 17 00:00:00 2001 From: IEL Date: Mon, 12 Oct 2020 09:00:09 +0000 Subject: [PATCH] [FIX] hr_expense: correct check for bank settings TLDR: fix a mess in journal fields check Steps: * Create expense "paid by Company" * Click Post Before: * AttributeError: 'account.journal' object has no attribute 'default_credit_account_id' After: * Either posted or shows user error about journal misconfiguration Notes: * Field ``default_credit_account_id`` is replaced in https://github.com/odoo/odoo/commit/41f119d5325dfbbf916d1d34e63946646ed4d44c * The error is introduced during incorrect forward-port #58852 --- task-2355177 closes odoo/odoo#59780 X-original-commit: 5c0fca662279702115b5e61c8227f82086693e38 Signed-off-by: Nicolas Martinelli (nim) Signed-off-by: Laurent Smet --- addons/hr_expense/i18n/hr_expense.pot | 7 +++++++ addons/hr_expense/models/hr_expense.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/hr_expense/i18n/hr_expense.pot b/addons/hr_expense/i18n/hr_expense.pot index 588f43baf32..779778afe2c 100644 --- a/addons/hr_expense/i18n/hr_expense.pot +++ b/addons/hr_expense/i18n/hr_expense.pot @@ -1036,6 +1036,13 @@ msgstr "" #. module: hr_expense #: code:addons/hr_expense/models/hr_expense.py:0 +#, python-format +msgid "" +"No Outstanding Payments Account found for the %s journal, please configure " +"one." +msgstr "" + +#. module: hr_expense #: code:addons/hr_expense/models/hr_expense.py:0 #, python-format msgid "No account found for the %s journal, please configure one." diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index f190dbe4da5..f5acb949107 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -387,8 +387,8 @@ Or send your receipts at