2022-11-07 22:11:41 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
|
|
# this repository contains the full copyright notices and license terms.
|
|
|
|
|
|
|
|
from trytond.model import ModelSQL, fields
|
2022-11-08 15:56:25 +00:00
|
|
|
from trytond.pool import PoolMeta
|
2022-11-07 22:11:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Cashbook(metaclass=PoolMeta):
|
|
|
|
__name__ = 'cashbook.book'
|
|
|
|
|
2023-06-05 19:06:03 +00:00
|
|
|
categories = fields.Many2Many(
|
|
|
|
string='Categories',
|
2022-11-07 22:11:41 +00:00
|
|
|
relation_name='cashbook.bookcategory-rel',
|
|
|
|
origin='cashbook', target='category')
|
|
|
|
|
|
|
|
# end Cashbook
|
|
|
|
|
|
|
|
|
|
|
|
class CategoryCashbookRel(ModelSQL):
|
|
|
|
'Category Cashbook Relation'
|
|
|
|
__name__ = 'cashbook.bookcategory-rel'
|
|
|
|
|
2023-06-05 19:06:03 +00:00
|
|
|
category = fields.Many2One(
|
|
|
|
string='Category', required=True, select=True,
|
2022-11-07 22:11:41 +00:00
|
|
|
model_name='cashbook.bookcategory', ondelete='CASCADE')
|
2023-06-05 19:06:03 +00:00
|
|
|
cashbook = fields.Many2One(
|
|
|
|
string='Cashbook', required=True, select=True,
|
2022-11-07 22:11:41 +00:00
|
|
|
model_name='cashbook.book', ondelete='CASCADE')
|
|
|
|
|
|
|
|
# end CategoryCashbookRel
|