Compare commits
13 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4fb5f625ce | ||
![]() |
282917a617 | ||
![]() |
f4597378c3 | ||
![]() |
2a4fbbabdd | ||
![]() |
7cf82a82ba | ||
![]() |
f7fca80ad7 | ||
![]() |
07df52b6e9 | ||
![]() |
abcb15c20f | ||
![]() |
032160ce76 | ||
![]() |
bda363b1e1 | ||
![]() |
f1ae2932a3 | ||
![]() |
750f5c7594 | ||
![]() |
2da0074d2b |
12 changed files with 84 additions and 73 deletions
|
@ -1,4 +1,4 @@
|
||||||
*.pyc
|
syntax: glob
|
||||||
build/*
|
build/*
|
||||||
mds_cashbook_bookcategory.egg-info/*
|
mds_cashbook_bookcategory.egg-info/*
|
||||||
dist/*
|
dist/*
|
22
README.rst
22
README.rst
|
@ -9,11 +9,27 @@ pip install mds-cashbook-bookcategory
|
||||||
|
|
||||||
Requires
|
Requires
|
||||||
========
|
========
|
||||||
- Tryton 7.0
|
- Tryton 6.0
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
=======
|
=======
|
||||||
|
|
||||||
*7.0.0 - 01.12.2023*
|
*6.0.4 - 05.06.2023*
|
||||||
|
|
||||||
- compatibilty to Tryton 7.0
|
- code optimized
|
||||||
|
|
||||||
|
*6.0.3 - 05.02.2023*
|
||||||
|
|
||||||
|
- updt: remove left/right fields
|
||||||
|
|
||||||
|
*6.0.2 - 08.11.2022*
|
||||||
|
|
||||||
|
- add: show linked cashbook on category-form
|
||||||
|
|
||||||
|
*6.0.1 - 08.11.2022*
|
||||||
|
|
||||||
|
- works
|
||||||
|
|
||||||
|
*6.0.0 - 07.11.2022*
|
||||||
|
|
||||||
|
- init
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
from trytond.pool import Pool
|
from trytond.pool import Pool
|
||||||
from .category import Category
|
from .category import Category
|
||||||
from .book import CategoryCashbookRel, Cashbook
|
from .book import CategoryCashbookRel, Cashbook
|
||||||
from .ir import Rule
|
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
|
@ -14,5 +13,4 @@ def register():
|
||||||
Category,
|
Category,
|
||||||
Cashbook,
|
Cashbook,
|
||||||
CategoryCashbookRel,
|
CategoryCashbookRel,
|
||||||
Rule,
|
|
||||||
module='cashbook_bookcategory', type_='model')
|
module='cashbook_bookcategory', type_='model')
|
||||||
|
|
4
book.py
4
book.py
|
@ -22,10 +22,10 @@ class CategoryCashbookRel(ModelSQL):
|
||||||
__name__ = 'cashbook.bookcategory-rel'
|
__name__ = 'cashbook.bookcategory-rel'
|
||||||
|
|
||||||
category = fields.Many2One(
|
category = fields.Many2One(
|
||||||
string='Category', required=True,
|
string='Category', required=True, select=True,
|
||||||
model_name='cashbook.bookcategory', ondelete='CASCADE')
|
model_name='cashbook.bookcategory', ondelete='CASCADE')
|
||||||
cashbook = fields.Many2One(
|
cashbook = fields.Many2One(
|
||||||
string='Cashbook', required=True,
|
string='Cashbook', required=True, select=True,
|
||||||
model_name='cashbook.book', ondelete='CASCADE')
|
model_name='cashbook.book', ondelete='CASCADE')
|
||||||
|
|
||||||
# end CategoryCashbookRel
|
# end CategoryCashbookRel
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Category(tree(separator=' / '), ModelSQL, ModelView):
|
||||||
name = fields.Char(string='Name', required=True, translate=True)
|
name = fields.Char(string='Name', required=True, translate=True)
|
||||||
|
|
||||||
parent = fields.Many2One(
|
parent = fields.Many2One(
|
||||||
string='Parent',
|
string='Parent', select=True,
|
||||||
model_name='cashbook.bookcategory', ondelete='CASCADE')
|
model_name='cashbook.bookcategory', ondelete='CASCADE')
|
||||||
childs = fields.One2Many(
|
childs = fields.One2Many(
|
||||||
string='Children', field='parent',
|
string='Children', field='parent',
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.rule" id="rg_category_rw_owner-1">
|
<record model="ir.rule" id="rg_category_rw_owner-1">
|
||||||
<field name="domain" eval="[
|
<field name="domain" eval="[
|
||||||
('create_uid.id', '=', Eval('user_id', -1)),
|
('create_uid.id', '=', Eval('user', {}).get('id', -1)),
|
||||||
]" pyson="1"/>
|
]" pyson="1"/>
|
||||||
<field name="rule_group" ref="rg_category_rw_owner"/>
|
<field name="rule_group" ref="rg_category_rw_owner"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
21
ir.py
21
ir.py
|
@ -1,21 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# This file is part of the cashbook-module from m-ds.de for Tryton.
|
|
||||||
# The COPYRIGHT file at the top level of this repository contains the
|
|
||||||
# full copyright notices and license terms.
|
|
||||||
|
|
||||||
from trytond.pool import PoolMeta
|
|
||||||
|
|
||||||
|
|
||||||
class Rule(metaclass=PoolMeta):
|
|
||||||
__name__ = 'ir.rule'
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def _context_modelnames(cls):
|
|
||||||
""" list of models to add 'user_id' to context
|
|
||||||
"""
|
|
||||||
result = super(Rule, cls)._context_modelnames()
|
|
||||||
return result | {
|
|
||||||
'cashbook.bookcategory',
|
|
||||||
}
|
|
||||||
|
|
||||||
# end Rule
|
|
70
setup.py
70
setup.py
|
@ -2,7 +2,7 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Always prefer setuptools over distutils
|
# Always prefer setuptools over distutils
|
||||||
from setuptools import setup
|
from setuptools import setup, find_packages
|
||||||
# To use a consistent encoding
|
# To use a consistent encoding
|
||||||
from codecs import open
|
from codecs import open
|
||||||
from os import path
|
from os import path
|
||||||
|
@ -36,10 +36,10 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f:
|
||||||
l2 = i.strip().split(';')
|
l2 = i.strip().split(';')
|
||||||
if len(l2) < 4:
|
if len(l2) < 4:
|
||||||
continue
|
continue
|
||||||
modversion[l2[0]] = {'min': l2[1], 'max': l2[2], 'prefix': l2[3]}
|
modversion[l2[0]] = {'min':l2[1], 'max':l2[2], 'prefix':l2[3]}
|
||||||
|
|
||||||
# tryton-version
|
# tryton-version
|
||||||
major_version = 7
|
major_version = 6
|
||||||
minor_version = 0
|
minor_version = 0
|
||||||
|
|
||||||
requires = []
|
requires = []
|
||||||
|
@ -51,21 +51,19 @@ for dep in info.get('depends', []):
|
||||||
prefix = modversion[dep]['prefix']
|
prefix = modversion[dep]['prefix']
|
||||||
|
|
||||||
if len(modversion[dep]['max']) > 0:
|
if len(modversion[dep]['max']) > 0:
|
||||||
requires.append('%s_%s >= %s, <= %s' % (
|
requires.append('%s_%s >= %s, <= %s' %
|
||||||
prefix, dep, modversion[dep]['min'],
|
(prefix, dep, modversion[dep]['min'], modversion[dep]['max']))
|
||||||
modversion[dep]['max']))
|
else :
|
||||||
else:
|
requires.append('%s_%s >= %s' %
|
||||||
requires.append('%s_%s >= %s' % (
|
(prefix, dep, modversion[dep]['min']))
|
||||||
prefix, dep, modversion[dep]['min']))
|
else :
|
||||||
else:
|
requires.append('%s_%s >= %s.%s, < %s.%s' %
|
||||||
requires.append('%s_%s >= %s.%s, < %s.%s' % (
|
('trytond', dep, major_version, minor_version,
|
||||||
'trytond', dep, major_version, minor_version,
|
|
||||||
major_version, minor_version + 1))
|
major_version, minor_version + 1))
|
||||||
requires.append('trytond >= %s.%s, < %s.%s' % (
|
requires.append('trytond >= %s.%s, < %s.%s' %
|
||||||
major_version, minor_version, major_version, minor_version + 1))
|
(major_version, minor_version, major_version, minor_version + 1))
|
||||||
|
|
||||||
setup(
|
setup(name='%s_%s' % (PREFIX, MODULE),
|
||||||
name='%s_%s' % (PREFIX, MODULE),
|
|
||||||
version=info.get('version', '0.0.1'),
|
version=info.get('version', '0.0.1'),
|
||||||
description='Tryton module to add categories for cashbooks.',
|
description='Tryton module to add categories for cashbooks.',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
|
@ -76,33 +74,35 @@ setup(
|
||||||
author_email='service@m-ds.de',
|
author_email='service@m-ds.de',
|
||||||
license='GPL-3',
|
license='GPL-3',
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
'Environment :: Plugins',
|
'Environment :: Plugins',
|
||||||
'Framework :: Tryton',
|
'Framework :: Tryton',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
'Intended Audience :: Customer Service',
|
'Intended Audience :: Customer Service',
|
||||||
'Intended Audience :: Information Technology',
|
'Intended Audience :: Information Technology',
|
||||||
'Intended Audience :: Financial and Insurance Industry',
|
'Intended Audience :: Financial and Insurance Industry',
|
||||||
'Topic :: Office/Business',
|
'Topic :: Office/Business',
|
||||||
'Topic :: Office/Business :: Financial :: Accounting',
|
'Topic :: Office/Business :: Financial :: Accounting',
|
||||||
'Natural Language :: German',
|
'Natural Language :: German',
|
||||||
'Natural Language :: English',
|
'Natural Language :: English',
|
||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||||
'Programming Language :: Python :: 3.7',
|
'Programming Language :: Python :: 3.7',
|
||||||
'Programming Language :: Python :: 3.8',
|
'Programming Language :: Python :: 3.8',
|
||||||
'Programming Language :: Python :: 3.9',
|
|
||||||
],
|
],
|
||||||
|
|
||||||
keywords='tryton cashbook category',
|
keywords='tryton cashbook category',
|
||||||
package_dir={'trytond.modules.%s' % MODULE: '.'},
|
package_dir={'trytond.modules.%s' % MODULE: '.'},
|
||||||
packages=[
|
packages=[
|
||||||
'trytond.modules.%s' % MODULE,
|
'trytond.modules.%s' % MODULE,
|
||||||
],
|
],
|
||||||
package_data={
|
package_data={
|
||||||
'trytond.modules.%s' % MODULE: (info.get('xml', []) + [
|
'trytond.modules.%s' % MODULE: (info.get('xml', [])
|
||||||
'tryton.cfg', 'locale/*.po', 'tests/*.py',
|
+ ['tryton.cfg', 'locale/*.po', 'tests/*.py',
|
||||||
'view/*.xml', 'versiondep.txt', 'README.rst']),
|
'view/*.xml',
|
||||||
|
'versiondep.txt', 'README.rst']),
|
||||||
},
|
},
|
||||||
|
|
||||||
install_requires=requires,
|
install_requires=requires,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
entry_points="""
|
entry_points="""
|
||||||
|
|
|
@ -2,3 +2,25 @@
|
||||||
# This file is part of the cashbook-module from m-ds for Tryton.
|
# 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
|
# The COPYRIGHT file at the top level of this repository contains the
|
||||||
# full copyright notices and license terms.
|
# full copyright notices and license terms.
|
||||||
|
|
||||||
|
import trytond.tests.test_tryton
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from .test_category import CategoryTestCase
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ['suite']
|
||||||
|
|
||||||
|
|
||||||
|
class CashbookCategoryTestCase(CategoryTestCase):
|
||||||
|
'Test cashbook module'
|
||||||
|
module = 'cashbook_bookcategory'
|
||||||
|
|
||||||
|
# end CashbookCategoryTestCase
|
||||||
|
|
||||||
|
|
||||||
|
def suite():
|
||||||
|
suite = trytond.tests.test_tryton.suite()
|
||||||
|
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||||
|
CashbookCategoryTestCase))
|
||||||
|
return suite
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
from trytond.tests.test_tryton import with_transaction
|
from trytond.tests.test_tryton import with_transaction
|
||||||
from trytond.pool import Pool
|
from trytond.pool import Pool
|
||||||
from trytond.transaction import Transaction
|
from trytond.transaction import Transaction
|
||||||
from trytond.modules.cashbook.tests.test_module import CashbookTestCase
|
from trytond.modules.cashbook.tests import CashbookTestCase
|
||||||
|
|
||||||
|
|
||||||
class CategoryTestCase(CashbookTestCase):
|
class CategoryTestCase(CashbookTestCase):
|
||||||
|
@ -98,6 +98,3 @@ class CategoryTestCase(CashbookTestCase):
|
||||||
self.assertEqual(len(book.categories), 0)
|
self.assertEqual(len(book.categories), 0)
|
||||||
|
|
||||||
# end CategoryTestCase
|
# end CategoryTestCase
|
||||||
|
|
||||||
|
|
||||||
del CashbookTestCase
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[tryton]
|
[tryton]
|
||||||
version=7.0.0
|
version=6.0.4
|
||||||
depends:
|
depends:
|
||||||
cashbook
|
cashbook
|
||||||
xml:
|
xml:
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cashbook;7.0.31;7.0.999;mds
|
cashbook;6.0.28;6.0.999;mds
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue