book, line, category, types: berechtigung für company-user + test,

book: währung neu,
line: buchungstyp, betrag, credit, debit, währung, sortierung
This commit is contained in:
Frederik Jaeckel 2022-08-10 16:30:08 +02:00
parent 1a85b8e80e
commit d57d76ba3b
20 changed files with 620 additions and 115 deletions

View file

@ -4,6 +4,7 @@
# full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields, Unique
from trytond.transaction import Transaction
class Type(ModelSQL, ModelView):
@ -12,6 +13,8 @@ class Type(ModelSQL, ModelView):
name = fields.Char(string='Name', required=True, translate=True)
short = fields.Char(string='Abbreviation', required=True, size=3)
company = fields.Many2One(string='Company', model_name='company.company',
required=True, ondelete="RESTRICT")
@classmethod
def __setup__(cls):
@ -39,4 +42,8 @@ class Type(ModelSQL, ModelView):
('short',) + tuple(clause[1:]),
]
@staticmethod
def default_company():
return Transaction().context.get('company') or None
# end Type