mirror of
https://github.com/NaN-tic/trytond-analytic_line_state.git
synced 2023-12-14 03:33:02 +01:00
I add extra depends on the three account_bank_statements modules to
ensure that when the cancel/delete order is coming from there is allowed even if the account move is posted. Task: #159291
This commit is contained in:
parent
43245fd3df
commit
e0cc8f03c6
|
@ -8,6 +8,7 @@ from trytond.pyson import Eval, Bool
|
||||||
from trytond.i18n import gettext
|
from trytond.i18n import gettext
|
||||||
from trytond.exceptions import UserError
|
from trytond.exceptions import UserError
|
||||||
from trytond.model.exceptions import AccessError
|
from trytond.model.exceptions import AccessError
|
||||||
|
from trytond.transaction import Transaction
|
||||||
|
|
||||||
__all__ = ['Configuration', 'Account', 'Move', 'MoveLine']
|
__all__ = ['Configuration', 'Account', 'Move', 'MoveLine']
|
||||||
|
|
||||||
|
@ -257,6 +258,9 @@ class MoveLine(metaclass=PoolMeta):
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
from_statement = Transaction().context.get(
|
||||||
|
'from_account_bank_statement_line', False)
|
||||||
|
if not from_statement:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.move.state == 'posted':
|
if line.move.state == 'posted':
|
||||||
raise AccessError(gettext(
|
raise AccessError(gettext(
|
||||||
|
|
|
@ -8,6 +8,9 @@ extras_depend:
|
||||||
account_invoice
|
account_invoice
|
||||||
analytic_invoice
|
analytic_invoice
|
||||||
analytic_account_move
|
analytic_account_move
|
||||||
|
account_bank_statement
|
||||||
|
account_bank_statement_counterpart
|
||||||
|
account_bank_statement_account
|
||||||
xml:
|
xml:
|
||||||
account.xml
|
account.xml
|
||||||
analytic.xml
|
analytic.xml
|
||||||
|
|
Loading…
Reference in a new issue