book/line: berechtigungen für owner, beobachter, bearbeiter + tests
This commit is contained in:
parent
654e9d2ee7
commit
b9bb433c39
9 changed files with 584 additions and 3 deletions
|
@ -7,6 +7,7 @@ from trytond.model import ModelView, ModelSQL, fields
|
|||
from trytond.pyson import PYSONEncoder
|
||||
from trytond.wizard import Wizard, StateView, StateAction, Button
|
||||
from trytond.i18n import gettext
|
||||
from trytond.pool import Pool
|
||||
|
||||
|
||||
class OpenCashBookStart(ModelView):
|
||||
|
@ -42,6 +43,20 @@ class OpenCashBook(Wizard):
|
|||
])
|
||||
open_ = StateAction('cashbook.act_line_view')
|
||||
|
||||
def default_start(self, fields):
|
||||
""" setup form
|
||||
"""
|
||||
Book = Pool().get('cashbook.book')
|
||||
|
||||
result = {}
|
||||
|
||||
books = Book.search([])
|
||||
print('\n## books:', books)
|
||||
if len(books) == 1:
|
||||
result['cashbook'] = books[0].id
|
||||
|
||||
return result
|
||||
|
||||
def do_open_(self, action):
|
||||
action['pyson_context'] = PYSONEncoder().encode({
|
||||
'cashbook': self.start.cashbook.id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue