diff --git a/account_move_protect_deleting/__manifest__.py b/account_move_protect_deleting/__manifest__.py index 60a8291..c0b2f09 100644 --- a/account_move_protect_deleting/__manifest__.py +++ b/account_move_protect_deleting/__manifest__.py @@ -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", diff --git a/account_move_protect_deleting/i18n/fr.po b/account_move_protect_deleting/i18n/fr.po index aeccbbf..56fb9a8 100644 --- a/account_move_protect_deleting/i18n/fr.po +++ b/account_move_protect_deleting/i18n/fr.po @@ -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." \ No newline at end of file +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." \ No newline at end of file diff --git a/account_move_protect_deleting/models/account_move.py b/account_move_protect_deleting/models/account_move.py index 8ed7e4c..abd24e9 100644 --- a/account_move_protect_deleting/models/account_move.py +++ b/account_move_protect_deleting/models/account_move.py @@ -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." - )) \ No newline at end of file + "You cannot delete this account move because it has been posted." + ))