neu: kategorie, config + test
This commit is contained in:
parent
b9bb433c39
commit
d6a8b254a3
28 changed files with 1255 additions and 35 deletions
19
line.py
19
line.py
|
@ -12,13 +12,13 @@ from trytond.exceptions import UserError
|
|||
from trytond.i18n import gettext
|
||||
from .book import sel_state_book
|
||||
|
||||
|
||||
sel_linetype = [
|
||||
('edit', 'Edit'),
|
||||
('check', 'Checked'),
|
||||
('done', 'Done'),
|
||||
]
|
||||
|
||||
|
||||
STATES = {
|
||||
'readonly': Or(
|
||||
Eval('state', '') != 'edit',
|
||||
|
@ -85,6 +85,17 @@ class LineContext(ModelView):
|
|||
context = Transaction().context
|
||||
return context.get('checked', False)
|
||||
|
||||
@classmethod
|
||||
def default_num_cashbook(cls):
|
||||
""" get default from context
|
||||
"""
|
||||
CashBook = Pool().get('cashbook.book')
|
||||
|
||||
with Transaction().set_context({
|
||||
'_check_access': True,
|
||||
}):
|
||||
return CashBook.search_count([])
|
||||
|
||||
@classmethod
|
||||
def default_done(cls):
|
||||
""" get default from context
|
||||
|
@ -96,8 +107,8 @@ class LineContext(ModelView):
|
|||
""" get number of accessible cashbooks,
|
||||
depends on user-permissions
|
||||
"""
|
||||
CashBook = Pool().get('cashbook.book')
|
||||
return CashBook.search_count([])
|
||||
LineContext = Pool().get('cashbook.line.context')
|
||||
return LineContext.default_num_cashbook()
|
||||
|
||||
# end LineContext
|
||||
|
||||
|
@ -119,6 +130,8 @@ class Line(Workflow, ModelSQL, ModelView):
|
|||
readonly=True, states={'invisible': True}, selection=sel_state_book),
|
||||
'on_change_with_state_cashbook', searcher='search_state_cashbook')
|
||||
|
||||
#image = fields.Binary...
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Line, cls).__setup__()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue