[IMP] account: warn msg decimal accuracy on modification

commit 31e1322b40 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) <sig@openerp.com>
This commit is contained in:
bve
2021-01-19 15:50:17 +00:00
committed by BVE
parent d4bcf5b694
commit 2ad912900e
4 changed files with 13 additions and 3 deletions
+1 -2
View File
@@ -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
+1 -1
View File
@@ -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)
+7
View File
@@ -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
@@ -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"/>