[IMP] account_advanced_protection_features: correct function button_draft when called on multiple moves
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m27s
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m27s
This commit is contained in:
@@ -5,11 +5,12 @@ class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
def button_draft(self):
|
||||
if self.is_move_sent and self.journal_id.prevent_reset_to_draft_sent_invoice:
|
||||
raise UserError(_(
|
||||
"You cannot reset to draft this invoice because it has been sent by email."
|
||||
))
|
||||
return super(AccountMove, self).button_draft()
|
||||
for move in self:
|
||||
if move.is_move_sent and move.journal_id.prevent_reset_to_draft_sent_invoice:
|
||||
raise UserError(_(
|
||||
"You cannot reset to draft this invoice because it has been sent by email."
|
||||
))
|
||||
return super().button_draft()
|
||||
|
||||
@api.ondelete(at_uninstall=False)
|
||||
def _check_posted(self):
|
||||
|
||||
Reference in New Issue
Block a user