[IMP] account_move_protect_deleting : change validated to posted after review
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
"maintainer": "Boris Gallet",
|
"maintainer": "Boris Gallet",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"category": "Tools",
|
"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
|
# any module necessary for this one to work correctly
|
||||||
"depends": [
|
"depends": [
|
||||||
"base",
|
"base",
|
||||||
|
@@ -19,5 +19,5 @@ msgstr ""
|
|||||||
#. odoo-python
|
#. odoo-python
|
||||||
#: code:addons/account_move_protect_deleting/models/account_move.py:0
|
#: code:addons/account_move_protect_deleting/models/account_move.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "You cannot delete this account move because it has been validated."
|
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é validée."
|
msgstr "Vous ne pouvez pas supprimer cette pièce comptable car elle à déjà été confirmée."
|
@@ -5,11 +5,11 @@ class AccountMove(models.Model):
|
|||||||
_inherit = 'account.move'
|
_inherit = 'account.move'
|
||||||
|
|
||||||
@api.ondelete(at_uninstall=False)
|
@api.ondelete(at_uninstall=False)
|
||||||
def _check_name(self):
|
def _check_posted(self):
|
||||||
""" Prevent deletion of a account move if it has been posted "/"
|
""" Prevent deletion of a account move if it has been posted
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if (self.posted_before):
|
if (self.posted_before):
|
||||||
raise UserError(_(""
|
raise UserError(_(""
|
||||||
"You cannot delete this account move because it has been validated."
|
"You cannot delete this account move because it has been posted."
|
||||||
))
|
))
|
Reference in New Issue
Block a user