From 2ad912900e4e467a89ba334300ff01b39716851a Mon Sep 17 00:00:00 2001 From: bve Date: Mon, 11 Jan 2021 14:52:19 +0000 Subject: [PATCH] [IMP] account: warn msg decimal accuracy on modification commit 31e1322b40ab33bf81d4c000f2b2a3f3eb8d0958 is allowing the customer to increase is decimal accuracy for currency without consequences but triggering issue upon lowering it if entries already exist. + Remove the redirection to the support. Let's ensure that the behavior is consistent and the users are warned on first modification. To do so, adding an alert msg in addition of the blocking message in case of lowering the decimal accuracy after already creating accounting entries. opw-2428857 closes odoo/odoo#64757 X-original-commit: 66533ebd88ed89c3baae6fdb1d0a28a458fa0cb9 Signed-off-by: Simon Goffin (sig) --- addons/account/i18n/account.pot | 3 +-- addons/account/models/res_currency.py | 2 +- odoo/addons/base/i18n/base.pot | 7 +++++++ odoo/addons/base/views/res_currency_views.xml | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index a5e821dd1c5..d02a6876c61 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -13694,8 +13694,7 @@ msgstr "" #, python-format msgid "" "You cannot reduce the number of decimal places of a currency which has " -"already been used to make accounting entries. If you really need to do that," -" please contact tech support." +"already been used to make accounting entries." msgstr "" #. module: account diff --git a/addons/account/models/res_currency.py b/addons/account/models/res_currency.py index 0e0a0c06217..964a60e973c 100644 --- a/addons/account/models/res_currency.py +++ b/addons/account/models/res_currency.py @@ -24,7 +24,7 @@ class ResCurrency(models.Model): rounding_val = vals['rounding'] for record in self: if (rounding_val > record.rounding or rounding_val == 0) and record._has_accounting_entries(): - raise UserError(_("You cannot reduce the number of decimal places of a currency which has already been used to make accounting entries. If you really need to do that, please contact tech support.")) + raise UserError(_("You cannot reduce the number of decimal places of a currency which has already been used to make accounting entries.")) return super(ResCurrency, self).write(vals) diff --git a/odoo/addons/base/i18n/base.pot b/odoo/addons/base/i18n/base.pot index 77ba5a2e824..f95b50b9690 100644 --- a/odoo/addons/base/i18n/base.pot +++ b/odoo/addons/base/i18n/base.pot @@ -25852,6 +25852,13 @@ msgid "" "created user under the Settings / Users menu." msgstr "" +#. module: base +#: model_terms:ir.ui.view,arch_db:base.view_currency_form +msgid "" +"You won't be able to reduce the number of decimal places of a currency which" +" has already been used to make accounting entries." +msgstr "" + #. module: base #: code:addons/base/models/ir_mail_server.py:0 #, python-format diff --git a/odoo/addons/base/views/res_currency_views.xml b/odoo/addons/base/views/res_currency_views.xml index b646e028f28..1be52955800 100644 --- a/odoo/addons/base/views/res_currency_views.xml +++ b/odoo/addons/base/views/res_currency_views.xml @@ -134,6 +134,10 @@ + +