cashbook/book.py

25 lines
749 B
Python
Raw Normal View History

2022-08-05 10:02:04 +00:00
# -*- 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')
2022-08-05 10:02:04 +00:00
@classmethod
def __setup__(cls):
super(Book, cls).__setup__()
cls._order.insert(0, ('name', 'ASC'))
# end Book