wizard report: button gesperrt wen keine abstimmung
This commit is contained in:
parent
04fdd9dc9e
commit
9e64c49dc0
1 changed files with 14 additions and 6 deletions
|
@ -39,6 +39,8 @@ class RunCbReportStart(ModelView):
|
||||||
self.reconciliations = self.on_change_with_reconciliations()
|
self.reconciliations = self.on_change_with_reconciliations()
|
||||||
if len(self.reconciliations or []) > 0:
|
if len(self.reconciliations or []) > 0:
|
||||||
self.reconciliation = self.reconciliations[0]
|
self.reconciliation = self.reconciliations[0]
|
||||||
|
else :
|
||||||
|
self.reconciliation = None
|
||||||
else :
|
else :
|
||||||
self.reconciliations = []
|
self.reconciliations = []
|
||||||
self.reconciliation = None
|
self.reconciliation = None
|
||||||
|
@ -66,7 +68,10 @@ class RunCbReport(Wizard):
|
||||||
selrecon = StateView('cashbook.runrepbook.start',
|
selrecon = StateView('cashbook.runrepbook.start',
|
||||||
'cashbook.runrepbook_view_form', [
|
'cashbook.runrepbook_view_form', [
|
||||||
Button(string='Cancel', state='end', icon='tryton-cancel'),
|
Button(string='Cancel', state='end', icon='tryton-cancel'),
|
||||||
Button(string='Report', state='report_', icon='tryton-ok', default=True),
|
Button(string='Report', state='report_', icon='tryton-ok', default=True,
|
||||||
|
states={
|
||||||
|
'readonly': ~Bool(Eval('reconciliation')),
|
||||||
|
}),
|
||||||
])
|
])
|
||||||
report_ = StateReport('cashbook.reprecon')
|
report_ = StateReport('cashbook.reprecon')
|
||||||
|
|
||||||
|
@ -108,11 +113,14 @@ class RunCbReport(Wizard):
|
||||||
""" run report
|
""" run report
|
||||||
"""
|
"""
|
||||||
# values for 'data' in report
|
# values for 'data' in report
|
||||||
r1 = {
|
if self.selrecon.reconciliation:
|
||||||
'model': self.selrecon.reconciliation.__name__,
|
r1 = {
|
||||||
'id': self.selrecon.reconciliation.id,
|
'model': self.selrecon.reconciliation.__name__,
|
||||||
'ids': [self.selrecon.reconciliation.id],
|
'id': self.selrecon.reconciliation.id,
|
||||||
}
|
'ids': [self.selrecon.reconciliation.id],
|
||||||
|
}
|
||||||
|
else :
|
||||||
|
r1 = {'model': '', 'id': None, 'ids': []}
|
||||||
return action, r1
|
return action, r1
|
||||||
|
|
||||||
def transition_report_(self):
|
def transition_report_(self):
|
||||||
|
|
Loading…
Reference in a new issue