cashbook/book.py
2022-08-05 16:47:43 +02:00

24 lines
749 B
Python

# -*- coding: utf-8 -*-
# This file is part of the cashbook-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, ModelSQL, fields
class Book(ModelSQL, ModelView):
'Account'
__name__ = 'cashbook.book'
name = fields.Char(string='Name', required=True)
btype = fields.Many2One(string='Account Type', required=True,
model_name='cashbook.type', ondelete='RESTRICT')
lines = fields.One2Many(string='Lines', field='account',
model_name='cashbook.line')
@classmethod
def __setup__(cls):
super(Book, cls).__setup__()
cls._order.insert(0, ('name', 'ASC'))
# end Book