Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1bfa987746 | ||
![]() |
f7fee173d7 | ||
![]() |
a98b4387c4 | ||
![]() |
176c8d93a7 | ||
![]() |
126daacf0a |
8 changed files with 67 additions and 44 deletions
2
.hgignore → .gitignore
vendored
2
.hgignore → .gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
syntax: glob
|
*.pyc
|
||||||
build/*
|
build/*
|
||||||
mds_cashbook_bookcategory.egg-info/*
|
mds_cashbook_bookcategory.egg-info/*
|
||||||
dist/*
|
dist/*
|
|
@ -9,11 +9,11 @@ pip install mds-cashbook-bookcategory
|
||||||
|
|
||||||
Requires
|
Requires
|
||||||
========
|
========
|
||||||
- Tryton 6.8
|
- Tryton 7.0
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
=======
|
=======
|
||||||
|
|
||||||
*6.8.4 - 05.06.2023*
|
*7.0.0 - 01.12.2023*
|
||||||
|
|
||||||
- code optimized, porting to Tryton 6.8
|
- compatibilty to Tryton 7.0
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
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():
|
||||||
|
@ -13,4 +14,5 @@ def register():
|
||||||
Category,
|
Category,
|
||||||
Cashbook,
|
Cashbook,
|
||||||
CategoryCashbookRel,
|
CategoryCashbookRel,
|
||||||
|
Rule,
|
||||||
module='cashbook_bookcategory', type_='model')
|
module='cashbook_bookcategory', type_='model')
|
||||||
|
|
|
@ -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', {}).get('id', -1)),
|
('create_uid.id', '=', Eval('user_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
Normal file
21
ir.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# -*- 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
|
41
setup.py
41
setup.py
|
@ -2,7 +2,7 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Always prefer setuptools over distutils
|
# Always prefer setuptools over distutils
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup
|
||||||
# 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,11 +36,11 @@ 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 = 6
|
major_version = 7
|
||||||
minor_version = 8
|
minor_version = 0
|
||||||
|
|
||||||
requires = []
|
requires = []
|
||||||
for dep in info.get('depends', []):
|
for dep in info.get('depends', []):
|
||||||
|
@ -51,19 +51,21 @@ 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'], modversion[dep]['max']))
|
prefix, dep, modversion[dep]['min'],
|
||||||
else :
|
modversion[dep]['max']))
|
||||||
requires.append('%s_%s >= %s' %
|
else:
|
||||||
(prefix, dep, modversion[dep]['min']))
|
requires.append('%s_%s >= %s' % (
|
||||||
else :
|
prefix, dep, modversion[dep]['min']))
|
||||||
requires.append('%s_%s >= %s.%s, < %s.%s' %
|
else:
|
||||||
('trytond', dep, major_version, minor_version,
|
requires.append('%s_%s >= %s.%s, < %s.%s' % (
|
||||||
|
'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(name='%s_%s' % (PREFIX, MODULE),
|
setup(
|
||||||
|
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,
|
||||||
|
@ -91,19 +93,16 @@ setup(name='%s_%s' % (PREFIX, MODULE),
|
||||||
'Programming Language :: Python :: 3.8',
|
'Programming Language :: Python :: 3.8',
|
||||||
'Programming Language :: Python :: 3.9',
|
'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',
|
'view/*.xml', 'versiondep.txt', 'README.rst']),
|
||||||
'versiondep.txt', 'README.rst']),
|
|
||||||
},
|
},
|
||||||
|
|
||||||
install_requires=requires,
|
install_requires=requires,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
entry_points="""
|
entry_points="""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[tryton]
|
[tryton]
|
||||||
version=6.8.4
|
version=7.0.0
|
||||||
depends:
|
depends:
|
||||||
cashbook
|
cashbook
|
||||||
xml:
|
xml:
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
cashbook;6.8.28;6.8.999;mds
|
cashbook;7.0.31;7.0.999;mds
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue