Add missing file in last commit.

This commit is contained in:
Bernat Brunet 2023-11-10 19:48:49 +01:00
parent b4a99d218c
commit 510e3d69f9
1 changed files with 19 additions and 0 deletions

19
move.py Normal file
View File

@ -0,0 +1,19 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.pool import PoolMeta
from trytond.i18n import gettext
from trytond.exceptions import UserError
class CancelMoves(metaclass=PoolMeta):
__name__ = 'account.move.cancel'
def transition_cancel(self):
moves = self.records
for move in moves:
if move.origin is not None:
raise UserError(gettext(
'account_es.msg_cancel_move_with_origin',
move=move.rec_name,
origin=move.origin.rec_name))
return super().transition_cancel()