cashbook_report/evaluation_context.py
2022-11-02 23:07:37 +01:00

25 lines
773 B
Python

# -*- coding: utf-8 -*-
# This file is part of the diagram-module from m-ds for Tryton.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
from trytond.model import ModelView, fields
from trytond.transaction import Transaction
class EvaluationContext(ModelView):
'Evaluation Context'
__name__ = 'cashbook_report.evaluation.context'
evaluation = fields.Many2One(string='Evaluation', readonly=True,
model_name='cashbook_report.evaluation',
states={'invisible': True})
@classmethod
def default_evaluation(cls):
""" get default from context
"""
context = Transaction().context
return context.get('evaluation', None)
# end EvaluationContext