state reconcile begonnen

This commit is contained in:
Frederik Jaeckel 2022-11-16 18:02:58 +01:00
parent fc3ddba3ab
commit 63a3f8f020
4 changed files with 28 additions and 3 deletions

21
line.py
View file

@ -26,6 +26,7 @@ sel_payee = [
sel_linetype = [
('edit', 'Edit'),
('check', 'Checked'),
('recon', 'Reconciled'),
('done', 'Done'),
]
@ -197,7 +198,9 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
])
cls._transitions |= set((
('edit', 'check'),
('check', 'done'),
('check', 'recon'),
('recon', 'done'),
('recon', 'check'),
('check', 'edit'),
))
cls._buttons.update({
@ -207,11 +210,15 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
'depends': ['state', 'reference'],
},
'wfcheck': {
'invisible': Eval('state') != 'edit',
'invisible': ~Eval('state', '').in_(['edit', 'recon']),
'depends': ['state'],
},
'wfrecon': {
'invisible': Eval('state') != 'check',
'depends': ['state'],
},
'wfdone': {
'invisible': Eval('state') != 'check',
'invisible': Eval('state') != 'recon',
'depends': ['state'],
},
})
@ -396,6 +403,14 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
new_lines = Line2.create(to_create_line)
Line2.wfcheck(new_lines)
@classmethod
@ModelView.button
@Workflow.transition('recon')
def wfrecon(cls, lines):
""" line is reconciled
"""
pass
@classmethod
@ModelView.button
@Workflow.transition('done')