summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbve <bve@odoo.com>2021-01-11 14:52:19 +0000
committerBVE <bve@odoo.com>2021-01-19 13:31:40 +0000
commit66533ebd88ed89c3baae6fdb1d0a28a458fa0cb9 (patch)
tree8866f966a073abbd6cdc0b74689fbabdaa817fdc
parent3ef5e63f62f0f84d6e92cb55eb112ab2f2924faa (diff)
[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#64344 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
-rw-r--r--addons/account/i18n/account.pot3
-rw-r--r--addons/account/models/res_currency.py2
-rw-r--r--odoo/addons/base/i18n/base.pot7
-rw-r--r--odoo/addons/base/views/res_currency_views.xml4
4 files changed, 13 insertions, 3 deletions
diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot
index 40a02ca05d3..5ab7d8f1ee4 100644
--- a/addons/account/i18n/account.pot
+++ b/addons/account/i18n/account.pot
@@ -13632,8 +13632,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 d52ad9bec96..c53143ee864 100644
--- a/odoo/addons/base/i18n/base.pot
+++ b/odoo/addons/base/i18n/base.pot
@@ -26056,6 +26056,13 @@ msgid ""
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
msgid ""
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 @@
</group>
</group>
+ <div class="oe_edit_only alert alert-info" role="alert">
+ You won't be able to reduce the number of decimal places of a currency which has already been used to make accounting entries.
+ </div>
+
<group groups="base.group_no_one">
<group string="Price Accuracy">
<field name="rounding"/>