ansicht der verbundenen kassenbücher an der kategorie + test
This commit is contained in:
parent
521b9c290c
commit
a9c627a63b
6 changed files with 27 additions and 2 deletions
3
book.py
3
book.py
|
@ -3,8 +3,7 @@
|
|||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.model import ModelSQL, fields
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
|
||||
class Cashbook(metaclass=PoolMeta):
|
||||
|
|
|
@ -23,6 +23,10 @@ class Category(tree(separator=' / '), ModelSQL, ModelView):
|
|||
left = fields.Integer(string='Left', required=True, select=True)
|
||||
right = fields.Integer(string='Right', required=True, select=True)
|
||||
|
||||
cashbooks = fields.Many2Many(string='Cashbooks',
|
||||
relation_name='cashbook.bookcategory-rel',
|
||||
origin='category', target='cashbook')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Category, cls).__setup__()
|
||||
|
|
|
@ -54,6 +54,10 @@ msgctxt "view:cashbook.bookcategory:"
|
|||
msgid "General Information"
|
||||
msgstr "Allgemein"
|
||||
|
||||
msgctxt "view:cashbook.bookcategory:"
|
||||
msgid "Cashbooks"
|
||||
msgstr "Kassenbücher"
|
||||
|
||||
msgctxt "field:cashbook.bookcategory,name:"
|
||||
msgid "Name"
|
||||
msgstr "Name"
|
||||
|
@ -78,6 +82,10 @@ msgctxt "field:cashbook.bookcategory,right:"
|
|||
msgid "Right"
|
||||
msgstr "Rechts"
|
||||
|
||||
msgctxt "field:cashbook.bookcategory,cashbooks:"
|
||||
msgid "Cashbooks"
|
||||
msgstr "Kassenbücher"
|
||||
|
||||
|
||||
#################
|
||||
# cashbook.book #
|
||||
|
|
|
@ -38,6 +38,10 @@ msgctxt "view:cashbook.bookcategory:"
|
|||
msgid "General Information"
|
||||
msgstr "General Information"
|
||||
|
||||
msgctxt "view:cashbook.bookcategory:"
|
||||
msgid "Cashbooks"
|
||||
msgstr "Cashbooks"
|
||||
|
||||
msgctxt "field:cashbook.bookcategory,name:"
|
||||
msgid "Name"
|
||||
msgstr "Name"
|
||||
|
@ -62,6 +66,10 @@ msgctxt "field:cashbook.bookcategory,right:"
|
|||
msgid "Right"
|
||||
msgstr "Right"
|
||||
|
||||
msgctxt "field:cashbook.bookcategory,cashbooks:"
|
||||
msgid "Cashbooks"
|
||||
msgstr "Cashbooks"
|
||||
|
||||
msgctxt "view:cashbook.book:"
|
||||
msgid "Categories"
|
||||
msgstr "Categories"
|
||||
|
|
|
@ -78,6 +78,9 @@ class CategoryTestCase(CashbookTestCase):
|
|||
self.assertEqual(len(book.categories), 1)
|
||||
self.assertEqual(book.categories[0].rec_name, 'Cat 0')
|
||||
|
||||
self.assertEqual(len(category.cashbooks), 1)
|
||||
self.assertEqual(category.cashbooks[0].rec_name, 'Book 1 | 0.00 usd | Open')
|
||||
|
||||
# replace category
|
||||
Book.write(*[
|
||||
[book],
|
||||
|
|
|
@ -12,6 +12,9 @@ full copyright notices and license terms. -->
|
|||
<field name="parent"/>
|
||||
<field name="childs" colspan="4"/>
|
||||
</page>
|
||||
<page string="Cashbooks" name="cashbooks" col="1">
|
||||
<field name="cashbooks"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="company" invisible="1"/>
|
||||
|
||||
|
|
Loading…
Reference in a new issue