[IMP] account_move_protect_deleting : change validated to posted after review

This commit is contained in:
Boris Gallet
2024-03-28 09:23:42 +01:00
parent 69b8e46925
commit 1b09ad77b6
3 changed files with 8 additions and 8 deletions

View File

@@ -9,7 +9,7 @@
"maintainer": "Boris Gallet",
"license": "AGPL-3",
"category": "Tools",
"summary": "Forbid to delete an account move that has already been validated",
"summary": "Forbid to delete an account move that has already been posted",
# any module necessary for this one to work correctly
"depends": [
"base",

View File

@@ -19,5 +19,5 @@ msgstr ""
#. odoo-python
#: code:addons/account_move_protect_deleting/models/account_move.py:0
#, python-format
msgid "You cannot delete this account move because it has been validated."
msgstr "Vous ne pouvez pas supprimer cette pièce comptable car elle à déjà été validée."
msgid "You cannot delete this account move because it has been posted."
msgstr "Vous ne pouvez pas supprimer cette pièce comptable car elle à déjà été confirmée."

View File

@@ -5,11 +5,11 @@ class AccountMove(models.Model):
_inherit = 'account.move'
@api.ondelete(at_uninstall=False)
def _check_name(self):
""" Prevent deletion of a account move if it has been posted "/"
def _check_posted(self):
""" Prevent deletion of a account move if it has been posted
"""
if (self.posted_before) :
if (self.posted_before):
raise UserError(_(""
"You cannot delete this account move because it has been validated."
))
"You cannot delete this account move because it has been posted."
))