line, book - wf + tests
This commit is contained in:
parent
ba442b726e
commit
654e9d2ee7
25 changed files with 786 additions and 160 deletions
|
@ -11,12 +11,12 @@ from trytond.i18n import gettext
|
|||
|
||||
class OpenCashBookStart(ModelView):
|
||||
'Open Cashbook'
|
||||
__name__ = 'cashbook.open_accountlines.start'
|
||||
__name__ = 'cashbook.open_lines.start'
|
||||
|
||||
account = fields.Many2One(string='Account', model_name='cashbook.book',
|
||||
cashbook = fields.Many2One(string='Cashbook', model_name='cashbook.book',
|
||||
required=True)
|
||||
checked = fields.Boolean(string='Checked', help="Show account lines in Checked-state.")
|
||||
done = fields.Boolean(string='Done', help="Show account lines in Done-state")
|
||||
checked = fields.Boolean(string='Checked', help="Show cashbook lines in Checked-state.")
|
||||
done = fields.Boolean(string='Done', help="Show cashbook lines in Done-state")
|
||||
date_from = fields.Date(string='Start Date')
|
||||
date_to = fields.Date(string='End Date')
|
||||
|
||||
|
@ -33,10 +33,10 @@ class OpenCashBookStart(ModelView):
|
|||
|
||||
class OpenCashBook(Wizard):
|
||||
'Open Cashbook'
|
||||
__name__ = 'cashbook.open_accountlines'
|
||||
__name__ = 'cashbook.open_lines'
|
||||
|
||||
start = StateView('cashbook.open_accountlines.start',
|
||||
'cashbook.open_accountlines_view_form', [
|
||||
start = StateView('cashbook.open_lines.start',
|
||||
'cashbook.open_lines_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Open', 'open_', 'tryton-ok', default=True),
|
||||
])
|
||||
|
@ -44,15 +44,15 @@ class OpenCashBook(Wizard):
|
|||
|
||||
def do_open_(self, action):
|
||||
action['pyson_context'] = PYSONEncoder().encode({
|
||||
'account': self.start.account.id,
|
||||
'cashbook': self.start.cashbook.id,
|
||||
'date_from': self.start.date_from,
|
||||
'date_to': self.start.date_to,
|
||||
'checked': self.start.checked,
|
||||
'done': self.start.done,
|
||||
})
|
||||
action['name'] = '%(name)s: %(account)s' % {
|
||||
action['name'] = '%(name)s: %(cashbook)s' % {
|
||||
'name': gettext('cashbook.msg_name_cashbook'),
|
||||
'account': self.start.account.rec_name,
|
||||
'cashbook': self.start.cashbook.rec_name,
|
||||
}
|
||||
return action, {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue