Compare commits
176 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
192c73e088 | ||
![]() |
5f13654653 | ||
![]() |
a33901fe7c | ||
![]() |
f0cfc479fe | ||
![]() |
2ea509dd07 | ||
![]() |
35cd838a62 | ||
![]() |
4e2b89ecf7 | ||
![]() |
a4509b4009 | ||
![]() |
f060d909fd | ||
![]() |
6bcc1109d7 | ||
![]() |
67cfa464a4 | ||
![]() |
543511a0b2 | ||
![]() |
2e9ff5620b | ||
![]() |
5b8fdd0088 | ||
![]() |
c6832e1f19 | ||
![]() |
85a96c12f8 | ||
![]() |
b1aa20a581 | ||
![]() |
5a23ac3c52 | ||
![]() |
fb0ef72d07 | ||
![]() |
01f1aff68f | ||
![]() |
c87f22674b | ||
![]() |
5f9f364720 | ||
![]() |
026388c32b | ||
![]() |
52588a1e02 | ||
![]() |
cf6acfa076 | ||
![]() |
97f78a2cd8 | ||
![]() |
9ef1468715 | ||
![]() |
0e30725d1f | ||
![]() |
50ce7f5dbc | ||
![]() |
57f5150ea9 | ||
![]() |
a5dd469cf3 | ||
![]() |
bbe71a8252 | ||
![]() |
a84791f1da | ||
![]() |
268e16dc64 | ||
![]() |
a5c8920d26 | ||
![]() |
2f65a18055 | ||
![]() |
0a5c0585a2 | ||
![]() |
440e4c66d5 | ||
![]() |
dc70beb0c9 | ||
![]() |
2bfe732c33 | ||
![]() |
bfb32219e2 | ||
![]() |
d5bc62ca78 | ||
![]() |
1793d3653e | ||
![]() |
1e722ae601 | ||
![]() |
14c027bf30 | ||
![]() |
f078ff6670 | ||
![]() |
ea737d61d2 | ||
![]() |
204a0a2623 | ||
![]() |
08e99bb84b | ||
![]() |
553e58371b | ||
![]() |
1a63415034 | ||
![]() |
b2e5890512 | ||
![]() |
f105e8bd6c | ||
![]() |
9d33086ff2 | ||
![]() |
3f487d2953 | ||
![]() |
34f647b7c9 | ||
![]() |
46e5fff805 | ||
![]() |
a5df1eefdd | ||
![]() |
5d6dcb6b12 | ||
![]() |
9398076ec8 | ||
![]() |
a8122666d6 | ||
![]() |
bd3e63753f | ||
![]() |
b6d9d06c4f | ||
![]() |
4daeadce2b | ||
![]() |
c758375075 | ||
![]() |
5449d452e9 | ||
![]() |
1c14b0134b | ||
![]() |
d12b0a4c7b | ||
![]() |
9d710183d1 | ||
![]() |
2d6a363fbe | ||
![]() |
3b77439635 | ||
![]() |
28595a0df3 | ||
![]() |
3ded493d11 | ||
![]() |
cbeb4d1993 | ||
![]() |
e6baaa92f0 | ||
![]() |
5f20001f72 | ||
![]() |
af0c825607 | ||
![]() |
7c1fb44cae | ||
![]() |
197de3213d | ||
![]() |
6a0f0fa9f7 | ||
![]() |
54a1b79710 | ||
![]() |
b923384a65 | ||
![]() |
cec1e9d3bd | ||
![]() |
54587cf93e | ||
![]() |
23ee20f277 | ||
![]() |
fa6a6324d7 | ||
![]() |
53f2c4249d | ||
![]() |
70fd1a83fb | ||
![]() |
403729d75f | ||
![]() |
77cb9d770e | ||
![]() |
124c109eea | ||
![]() |
b9a08d7bd9 | ||
![]() |
e4e06000d3 | ||
![]() |
636c1c2654 | ||
![]() |
b81d5fc0f4 | ||
![]() |
56b4099fb3 | ||
![]() |
48d803ce78 | ||
![]() |
e4423be23e | ||
![]() |
a1784abed6 | ||
![]() |
200bcf7737 | ||
![]() |
b260fa7e24 | ||
![]() |
859a7f6225 | ||
![]() |
51c74cb42e | ||
![]() |
de168a8476 | ||
![]() |
233619d034 | ||
![]() |
559882b332 | ||
![]() |
8992cfd64c | ||
![]() |
4c12d8723a | ||
![]() |
b325035a90 | ||
![]() |
f217d70e61 | ||
![]() |
47fc4abd58 | ||
![]() |
4b8f5f279a | ||
![]() |
aa6cc97dcf | ||
![]() |
32bf33fb23 | ||
![]() |
62188ebfd2 | ||
![]() |
d5fd206bf5 | ||
![]() |
f11fdfefcd | ||
![]() |
9e612d63b1 | ||
![]() |
f21eb9f9c7 | ||
![]() |
1e552cca4a | ||
![]() |
53c898e0a4 | ||
![]() |
7604feacf3 | ||
![]() |
17f666dc0c | ||
![]() |
7f1b826590 | ||
![]() |
0572e18b64 | ||
![]() |
47de6304b2 | ||
![]() |
aab73ff871 | ||
![]() |
3f317d80b2 | ||
![]() |
fdd7290cfc | ||
![]() |
785ec8f9a9 | ||
![]() |
e024044ccc | ||
![]() |
8421db2221 | ||
![]() |
57ade40eb8 | ||
![]() |
96cfe3a32c | ||
![]() |
ec4466176e | ||
![]() |
843ade71e9 | ||
![]() |
b2147f56b3 | ||
![]() |
1fee218ee6 | ||
![]() |
fe8a6bbed6 | ||
![]() |
5fd4bb9093 | ||
![]() |
dca9732fce | ||
![]() |
7d97128f24 | ||
![]() |
48d6246611 | ||
![]() |
638524a2c3 | ||
![]() |
9103f828dc | ||
![]() |
e14dd92c36 | ||
![]() |
c24fdef4cf | ||
![]() |
f2b228aba6 | ||
![]() |
46515aaf26 | ||
![]() |
a2cb2b308b | ||
![]() |
25db274d2d | ||
![]() |
11b3f7d004 | ||
![]() |
75a873e25d | ||
![]() |
de0de8a85f | ||
![]() |
0fcc997f28 | ||
![]() |
5797f42489 | ||
![]() |
4afd9f835d | ||
![]() |
70ef448beb | ||
![]() |
34a4958936 | ||
![]() |
f661f5ed38 | ||
![]() |
19389b3865 | ||
![]() |
b4e7cface3 | ||
![]() |
bb24a94cd1 | ||
![]() |
f76f91b35a | ||
![]() |
8abeb63441 | ||
![]() |
8b0a2a6ccd | ||
![]() |
613f4e9767 | ||
![]() |
a84e3ed8ba | ||
![]() |
4876b06421 | ||
![]() |
619a4e9ed6 | ||
![]() |
559a5d0656 | ||
![]() |
2fdee39611 | ||
![]() |
4df6284257 | ||
![]() |
0aa9df2f1d | ||
![]() |
dadcfb618f | ||
![]() |
603a9d7477 |
30 changed files with 259 additions and 211 deletions
|
@ -1,4 +1,4 @@
|
|||
*.pyc
|
||||
syntax: glob
|
||||
build/*
|
||||
dist/*
|
||||
mds_cashbook.egg-info/*
|
148
README.rst
148
README.rst
|
@ -9,7 +9,7 @@ pip install mds-cashbook
|
|||
|
||||
Requires
|
||||
========
|
||||
- Tryton 7.0
|
||||
- Tryton 6.0
|
||||
|
||||
How to
|
||||
======
|
||||
|
@ -153,6 +153,148 @@ currency are converted into the display currency of the parent cash book.
|
|||
Changes
|
||||
=======
|
||||
|
||||
*7.0.0 - 30.11.2023*
|
||||
*6.0.35 - 01.06.2024*
|
||||
|
||||
- compatibility to Tryton 7.0
|
||||
- add: config setting for fixate in booking-wizard
|
||||
|
||||
*6.0.34 - 30.05.2024*
|
||||
|
||||
- add: fixate of booking from booking-wizard
|
||||
|
||||
*6.0.33 - 31.12.2023*
|
||||
|
||||
- remove caching
|
||||
- add worker-based precalculation of cashbook-values
|
||||
|
||||
*6.0.31 - 30.11.2023*
|
||||
|
||||
- optimized ir.rule
|
||||
|
||||
*6.0.30 - 25.07.2023*
|
||||
|
||||
- updt: optimize code, add tests
|
||||
|
||||
*6.0.28 - 05.06.2023*
|
||||
|
||||
- code optimized
|
||||
|
||||
*6.0.27 - 05.03.2023*
|
||||
|
||||
- updt: optimize caching
|
||||
- add: settings for trytond.conf
|
||||
|
||||
*6.0.26 - 27.02.2023*
|
||||
|
||||
- updt: cashbook-form optimized
|
||||
- add: caching
|
||||
|
||||
*6.0.25 - 14.02.2023*
|
||||
|
||||
- fix: possible exception by invalid date in context
|
||||
- updt: optimize table + icon
|
||||
|
||||
*6.0.24 - 05.02.2023*
|
||||
|
||||
- fix: rewrite of line-values
|
||||
|
||||
*6.0.23 - 28.01.2023*
|
||||
|
||||
- fix: selection of subordinate cash books for calculations
|
||||
|
||||
*6.0.22 - 21.01.2023*
|
||||
|
||||
- add: enable extension by investment-module
|
||||
- updt: optimize form/list-views
|
||||
|
||||
*6.0.21 - 29.11.2022*
|
||||
|
||||
- updt: remove 'reconcile' button from line-form
|
||||
- add: how to
|
||||
|
||||
*6.0.20 - 16.11.2022*
|
||||
|
||||
- add: new state 'reconciled' at line
|
||||
|
||||
*6.0.19 - 19.10.2022*
|
||||
|
||||
- fix: delete()
|
||||
|
||||
*6.0.18 - 11.10.2022*
|
||||
|
||||
- updt: optimized open/view of cashbook
|
||||
|
||||
*6.0.17 - 10.10.2022*
|
||||
|
||||
- add: colors for cashbook-lines
|
||||
- add: client stores tree-state of cashbook
|
||||
|
||||
*6.0.16 - 07.10.2022*
|
||||
|
||||
- add: open cashbook-lines from cashbook
|
||||
|
||||
*6.0.15 - 04.10.2022*
|
||||
|
||||
- updt: second-currency support optimized
|
||||
|
||||
*6.0.14 - 30.09.2022*
|
||||
|
||||
- fix: parameter
|
||||
|
||||
*6.0.13 - 28.09.2022*
|
||||
|
||||
- hierarchical ordering for cashbook
|
||||
- forms optimzed
|
||||
|
||||
*6.0.12 - 18.09.2022*
|
||||
|
||||
- add: selected cashbooks in 'enter-booking-dialog'
|
||||
|
||||
*6.0.11 - 16.09.2022*
|
||||
|
||||
- add: hierarchy for cashbooks
|
||||
|
||||
*6.0.10 - 13.09.2022*
|
||||
|
||||
- add: split-booking with transfer
|
||||
|
||||
*6.0.9 - 08.09.2022*
|
||||
|
||||
- updt: allow negative amounts
|
||||
|
||||
*6.0.8 - 07.09.2022*
|
||||
|
||||
- updt: enter-booking form optimized
|
||||
|
||||
*6.0.7 - 07.09.2022*
|
||||
|
||||
- add: enter-booking-wizard
|
||||
|
||||
*6.0.6 - 06.09.2022*
|
||||
|
||||
- updt: optimized form - line, line-context
|
||||
- updt: extended search in cashbook-lines
|
||||
|
||||
*6.0.5 - 05.09.2022*
|
||||
|
||||
- updt: view of book + line optimized
|
||||
|
||||
*6.0.4 - 05.09.2022*
|
||||
|
||||
- fix: write number at state-change 'check' -> 'done'
|
||||
- updt: speedup transaction view
|
||||
|
||||
*6.0.3 - 31.08.2022*
|
||||
|
||||
- updt: checks, sorting
|
||||
|
||||
*6.0.2 - 25.08.2022*
|
||||
|
||||
- add: split-booking
|
||||
|
||||
*6.0.1 - 23.08.2022*
|
||||
|
||||
- works
|
||||
|
||||
*6.0.0 - 05.08.2022*
|
||||
|
||||
- init
|
||||
|
|
|
@ -17,7 +17,6 @@ from .reconciliation import Reconciliation
|
|||
from .cbreport import ReconciliationReport
|
||||
from .currency import CurrencyRate
|
||||
from .valuestore import ValueStore
|
||||
from .ir import Rule
|
||||
from .cron import Cron
|
||||
|
||||
|
||||
|
@ -37,7 +36,6 @@ def register():
|
|||
RunCbReportStart,
|
||||
EnterBookingStart,
|
||||
ValueStore,
|
||||
Rule,
|
||||
Cron,
|
||||
module='cashbook', type_='model')
|
||||
Pool.register(
|
||||
|
|
38
book.py
38
book.py
|
@ -3,8 +3,7 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the
|
||||
# full copyright notices and license terms.
|
||||
|
||||
from trytond.model import (
|
||||
Workflow, ModelView, ModelSQL, fields, Check, tree, Index)
|
||||
from trytond.model import Workflow, ModelView, ModelSQL, fields, Check, tree
|
||||
from trytond.pyson import Eval, Or, Bool, Id
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
|
@ -50,13 +49,13 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView):
|
|||
|
||||
company = fields.Many2One(
|
||||
string='Company', model_name='company.company',
|
||||
required=True, ondelete="RESTRICT")
|
||||
required=True, select=True, ondelete="RESTRICT")
|
||||
name = fields.Char(
|
||||
string='Name', required=True, states=STATES, depends=DEPENDS)
|
||||
description = fields.Text(
|
||||
string='Description', states=STATES, depends=DEPENDS)
|
||||
btype = fields.Many2One(
|
||||
string='Type',
|
||||
string='Type', select=True,
|
||||
help='A cash book with type can contain postings. ' +
|
||||
'Without type is a view.',
|
||||
model_name='cashbook.type', ondelete='RESTRICT',
|
||||
|
@ -69,16 +68,16 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView):
|
|||
string='Feature', readonly=True,
|
||||
states={'invisible': True}), 'on_change_with_feature')
|
||||
owner = fields.Many2One(
|
||||
string='Owner', required=True,
|
||||
string='Owner', required=True, select=True,
|
||||
model_name='res.user', ondelete='SET NULL',
|
||||
states=STATES, depends=DEPENDS)
|
||||
reviewer = fields.Many2One(
|
||||
string='Reviewer',
|
||||
string='Reviewer', select=True,
|
||||
help='Group of users who have write access to the cashbook.',
|
||||
model_name='res.group', ondelete='SET NULL',
|
||||
states=STATES, depends=DEPENDS)
|
||||
observer = fields.Many2One(
|
||||
string='Observer',
|
||||
string='Observer', select=True,
|
||||
help='Group of users who have read-only access to the cashbook.',
|
||||
model_name='res.group', ondelete='SET NULL',
|
||||
states=STATES, depends=DEPENDS)
|
||||
|
@ -153,7 +152,7 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView):
|
|||
'on_change_with_currency_digits')
|
||||
|
||||
currency = fields.Many2One(
|
||||
string='Currency',
|
||||
string='Currency', select=True,
|
||||
model_name='currency.currency',
|
||||
states={
|
||||
'readonly': Or(
|
||||
|
@ -190,29 +189,6 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView):
|
|||
cls._order.insert(0, ('rec_name', 'ASC'))
|
||||
cls._order.insert(0, ('state', 'ASC'))
|
||||
t = cls.__table__()
|
||||
cls._sql_indexes.update({
|
||||
Index(
|
||||
t,
|
||||
(t.btype, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.company, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.currency, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.state, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.owner, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.reviewer, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.observer, Index.Equality())),
|
||||
})
|
||||
cls._sql_constraints.extend([
|
||||
('state_val',
|
||||
Check(t, t.state.in_(['open', 'closed', 'archive'])),
|
||||
|
|
2
book.xml
2
book.xml
|
@ -121,7 +121,7 @@ full copyright notices and license terms. -->
|
|||
</record>
|
||||
<record model="ir.rule" id="rg_book_rw_owner-1">
|
||||
<field name="domain" eval="[
|
||||
('owner.id', '=', Eval('user_id', -1)),
|
||||
('owner.id', '=', Eval('user', {}).get('id', -1)),
|
||||
]" pyson="1"/>
|
||||
<field name="rule_group" ref="rg_book_rw_owner"/>
|
||||
</record>
|
||||
|
|
24
ir.py
24
ir.py
|
@ -1,24 +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.book',
|
||||
'cashbook.line',
|
||||
'cashbook.recon',
|
||||
'cashbook.split'
|
||||
}
|
||||
|
||||
# end Rule
|
39
line.py
39
line.py
|
@ -3,7 +3,7 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the
|
||||
# full copyright notices and license terms.
|
||||
|
||||
from trytond.model import ModelView, ModelSQL, Workflow, fields, Check, Index
|
||||
from trytond.model import ModelView, ModelSQL, Workflow, fields, Check
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval, If, Or, Bool, Date
|
||||
from trytond.transaction import Transaction
|
||||
|
@ -54,24 +54,24 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
__name__ = 'cashbook.line'
|
||||
|
||||
cashbook = fields.Many2One(
|
||||
string='Cashbook', required=True,
|
||||
string='Cashbook', required=True, select=True,
|
||||
model_name='cashbook.book', ondelete='CASCADE', readonly=True,
|
||||
domain=[('btype', '!=', None)])
|
||||
date = fields.Date(
|
||||
string='Date', required=True,
|
||||
string='Date', required=True, select=True,
|
||||
states=STATES, depends=DEPENDS)
|
||||
month = fields.Function(fields.Integer(
|
||||
string='Month', readonly=True),
|
||||
'on_change_with_month', searcher='search_month')
|
||||
number = fields.Char(string='Number', readonly=True)
|
||||
description = fields.Text(
|
||||
string='Description',
|
||||
string='Description', select=True,
|
||||
states=STATES, depends=DEPENDS)
|
||||
descr_short = fields.Function(fields.Char(
|
||||
string='Description', readonly=True),
|
||||
'on_change_with_descr_short', searcher='search_descr_short')
|
||||
category = fields.Many2One(
|
||||
string='Category',
|
||||
string='Category', select=True,
|
||||
model_name='cashbook.category', ondelete='RESTRICT',
|
||||
states={
|
||||
'readonly': Or(
|
||||
|
@ -98,7 +98,7 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
|
||||
bookingtype = fields.Selection(
|
||||
string='Type', required=True,
|
||||
help='Type of Booking', selection=sel_bookingtype,
|
||||
help='Type of Booking', selection=sel_bookingtype, select=True,
|
||||
states=STATES, depends=DEPENDS)
|
||||
bookingtype_string = bookingtype.translated('bookingtype')
|
||||
amount = fields.Numeric(
|
||||
|
@ -145,7 +145,7 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
|
||||
# link to lines created by this record
|
||||
reference = fields.Many2One(
|
||||
string='Reference', readonly=True,
|
||||
string='Reference', readonly=True, select=True,
|
||||
states={
|
||||
'invisible': ~Bool(Eval('reference')),
|
||||
}, model_name='cashbook.line', ondelete='CASCADE',
|
||||
|
@ -198,7 +198,7 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
|
||||
state = fields.Selection(
|
||||
string='State', required=True, readonly=True,
|
||||
selection=sel_linestate)
|
||||
select=True, selection=sel_linestate)
|
||||
state_string = state.translated('state')
|
||||
state_cashbook = fields.Function(fields.Selection(
|
||||
string='State of Cashbook',
|
||||
|
@ -224,27 +224,6 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
cls._order.insert(0, ('date', 'ASC'))
|
||||
cls._order.insert(0, ('state', 'ASC'))
|
||||
t = cls.__table__()
|
||||
|
||||
cls._sql_indexes.update({
|
||||
Index(
|
||||
t,
|
||||
(t.date, Index.Range(order='ASC'))),
|
||||
Index(
|
||||
t,
|
||||
(t.description, Index.Similarity())),
|
||||
Index(
|
||||
t,
|
||||
(t.category, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.bookingtype, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.state, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.reference, Index.Equality())),
|
||||
})
|
||||
cls._sql_constraints.extend([
|
||||
('state_val2',
|
||||
Check(t, t.state.in_(['edit', 'check', 'done', 'recon'])),
|
||||
|
@ -679,7 +658,7 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
|
||||
@fields.depends('category')
|
||||
def on_change_with_category_view(self, name=None):
|
||||
""" show optimized form of category for list-view
|
||||
""" show optimizef form of category for list-view
|
||||
"""
|
||||
Configuration = Pool().get('cashbook.configuration')
|
||||
|
||||
|
|
2
line.xml
2
line.xml
|
@ -145,7 +145,7 @@ full copyright notices and license terms. -->
|
|||
</record>
|
||||
<record model="ir.rule" id="rg_line_write-1">
|
||||
<field name="domain" eval="['OR',
|
||||
('cashbook.owner.id', '=', Eval('user_id', -1)),
|
||||
('cashbook.owner.id', '=', Eval('user', {}).get('id', -1)),
|
||||
('cashbook.reviewer.id', 'in', Eval('groups', [])),
|
||||
]" pyson="1"/>
|
||||
<field name="rule_group" ref="rg_line_write"/>
|
||||
|
|
12
locale/de.po
12
locale/de.po
|
@ -466,6 +466,10 @@ msgctxt "view:cashbook.book:"
|
|||
msgid "Amount and Numbering"
|
||||
msgstr "Betrag und Nummerierung"
|
||||
|
||||
msgctxt "view:cashbook.book:"
|
||||
msgid "Balance"
|
||||
msgstr "Saldo"
|
||||
|
||||
msgctxt "view:cashbook.book:"
|
||||
msgid "Reconciliations"
|
||||
msgstr "Abstimmungen"
|
||||
|
@ -790,6 +794,14 @@ msgctxt "model:cashbook.line,name:"
|
|||
msgid "Cashbook Line"
|
||||
msgstr "Kassenbuchzeile"
|
||||
|
||||
msgctxt "view:cashbook.line:"
|
||||
msgid "Credit"
|
||||
msgstr "Einnahme"
|
||||
|
||||
msgctxt "view:cashbook.line:"
|
||||
msgid "Debit"
|
||||
msgstr "Ausgabe"
|
||||
|
||||
msgctxt "view:cashbook.line:"
|
||||
msgid "Cashbook Line"
|
||||
msgstr "Kassenbuchzeile"
|
||||
|
|
12
locale/en.po
12
locale/en.po
|
@ -426,6 +426,10 @@ msgctxt "view:cashbook.book:"
|
|||
msgid "Amount and Numbering"
|
||||
msgstr "Amount and Numbering"
|
||||
|
||||
msgctxt "view:cashbook.book:"
|
||||
msgid "Balance"
|
||||
msgstr "Balance"
|
||||
|
||||
msgctxt "view:cashbook.book:"
|
||||
msgid "Reconciliations"
|
||||
msgstr "Reconciliations"
|
||||
|
@ -742,6 +746,14 @@ msgctxt "model:cashbook.line,name:"
|
|||
msgid "Cashbook Line"
|
||||
msgstr "Cashbook Line"
|
||||
|
||||
msgctxt "view:cashbook.line:"
|
||||
msgid "Credit"
|
||||
msgstr "Credit"
|
||||
|
||||
msgctxt "view:cashbook.line:"
|
||||
msgid "Debit"
|
||||
msgstr "Debit"
|
||||
|
||||
msgctxt "view:cashbook.line:"
|
||||
msgid "Cashbook Line"
|
||||
msgstr "Cashbook Line"
|
||||
|
|
10
model.py
10
model.py
|
@ -3,8 +3,7 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the
|
||||
# full copyright notices and license terms.
|
||||
|
||||
from trytond.model import (
|
||||
MultiValueMixin, ValueMixin, fields, Unique, Index)
|
||||
from trytond.model import MultiValueMixin, ValueMixin, fields, Unique, Model
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
from sql import With
|
||||
|
@ -123,17 +122,12 @@ def order_name_hierarchical(model_name, tables):
|
|||
class UserValueMixin(ValueMixin):
|
||||
iduser = fields.Many2One(
|
||||
model_name='res.user', string="User",
|
||||
ondelete='CASCADE', required=True)
|
||||
select=True, ondelete='CASCADE', required=True)
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(UserValueMixin, cls).__setup__()
|
||||
tab_val = cls.__table__()
|
||||
cls._sql_indexes.update({
|
||||
Index(
|
||||
tab_val,
|
||||
(tab_val.iduser, Index.Equality())),
|
||||
})
|
||||
cls._sql_constraints.extend([
|
||||
('val_uniq',
|
||||
Unique(tab_val, tab_val.iduser),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the
|
||||
# full copyright notices and license terms.
|
||||
|
||||
from trytond.model import Workflow, ModelView, ModelSQL, fields, Index
|
||||
from trytond.model import Workflow, ModelView, ModelSQL, fields
|
||||
from trytond.pyson import Eval, If, Or
|
||||
from trytond.pool import Pool
|
||||
from trytond.report import Report
|
||||
|
@ -34,10 +34,10 @@ class Reconciliation(Workflow, ModelSQL, ModelView):
|
|||
__name__ = 'cashbook.recon'
|
||||
|
||||
cashbook = fields.Many2One(
|
||||
string='Cashbook', required=True,
|
||||
string='Cashbook', required=True, select=True,
|
||||
model_name='cashbook.book', ondelete='CASCADE', readonly=True)
|
||||
date = fields.Date(
|
||||
string='Date', required=True,
|
||||
string='Date', required=True, select=True,
|
||||
states=STATES, depends=DEPENDS)
|
||||
feature = fields.Function(fields.Char(
|
||||
string='Feature', readonly=True,
|
||||
|
@ -54,7 +54,7 @@ class Reconciliation(Workflow, ModelSQL, ModelView):
|
|||
states=STATES, depends=DEPENDS+['date_to'])
|
||||
date_to = fields.Date(
|
||||
string='End Date',
|
||||
required=True,
|
||||
required=True, select=True,
|
||||
domain=[
|
||||
If(Eval('date_to') & Eval('date_from'),
|
||||
('date_from', '<=', Eval('date_to')),
|
||||
|
@ -98,7 +98,7 @@ class Reconciliation(Workflow, ModelSQL, ModelView):
|
|||
|
||||
state = fields.Selection(
|
||||
string='State', required=True, readonly=True,
|
||||
selection=sel_reconstate)
|
||||
select=True, selection=sel_reconstate)
|
||||
state_string = state.translated('state')
|
||||
state_cashbook = fields.Function(fields.Selection(
|
||||
string='State of Cashbook',
|
||||
|
@ -109,7 +109,6 @@ class Reconciliation(Workflow, ModelSQL, ModelView):
|
|||
def __setup__(cls):
|
||||
super(Reconciliation, cls).__setup__()
|
||||
cls._order.insert(0, ('date_from', 'DESC'))
|
||||
t = cls.__table__()
|
||||
cls._transitions |= set((
|
||||
('edit', 'check'),
|
||||
('check', 'done'),
|
||||
|
@ -129,23 +128,6 @@ class Reconciliation(Workflow, ModelSQL, ModelView):
|
|||
'depends': ['state'],
|
||||
},
|
||||
})
|
||||
cls._sql_indexes.update({
|
||||
Index(
|
||||
t,
|
||||
(t.cashbook, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.date, Index.Range())),
|
||||
Index(
|
||||
t,
|
||||
(t.date_to, Index.Range())),
|
||||
Index(
|
||||
t,
|
||||
(t.date_from, Index.Range(order='DESC'))),
|
||||
Index(
|
||||
t,
|
||||
(t.state, Index.Equality())),
|
||||
})
|
||||
|
||||
def check_overlap_dates(self):
|
||||
""" deny overlap of date_from/date_to between records of same cashbook
|
||||
|
|
|
@ -96,7 +96,7 @@ full copyright notices and license terms. -->
|
|||
</record>
|
||||
<record model="ir.rule" id="rg_recon_write-1">
|
||||
<field name="domain" eval="['OR',
|
||||
('cashbook.owner.id', '=', Eval('user_id', -1)),
|
||||
('cashbook.owner.id', '=', Eval('user', {}).get('id', -1)),
|
||||
('cashbook.reviewer.id', 'in', Eval('groups', [])),
|
||||
]" pyson="1"/>
|
||||
<field name="rule_group" ref="rg_recon_write"/>
|
||||
|
|
3
setup.py
3
setup.py
|
@ -39,7 +39,7 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f:
|
|||
modversion[l2[0]] = {'min': l2[1], 'max': l2[2], 'prefix': l2[3]}
|
||||
|
||||
# tryton-version
|
||||
major_version = 7
|
||||
major_version = 6
|
||||
minor_version = 0
|
||||
|
||||
requires = ['python-slugify']
|
||||
|
@ -91,7 +91,6 @@ setup(
|
|||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
],
|
||||
|
||||
keywords='tryton cashbook',
|
||||
|
|
29
splitline.py
29
splitline.py
|
@ -4,7 +4,7 @@
|
|||
# full copyright notices and license terms.
|
||||
|
||||
|
||||
from trytond.model import ModelView, ModelSQL, fields, Index
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval, If
|
||||
from trytond.report import Report
|
||||
|
@ -31,16 +31,16 @@ class SplitLine(SecondCurrencyMixin, ModelSQL, ModelView):
|
|||
|
||||
line = fields.Many2One(
|
||||
string='Line', required=True,
|
||||
ondelete='CASCADE', model_name='cashbook.line',
|
||||
select=True, ondelete='CASCADE', model_name='cashbook.line',
|
||||
readonly=True)
|
||||
description = fields.Text(
|
||||
string='Description', states=STATES, depends=DEPENDS)
|
||||
splittype = fields.Selection(
|
||||
string='Type', required=True,
|
||||
help='Type of split booking line', selection=sel_linetype,
|
||||
states=STATES, depends=DEPENDS)
|
||||
states=STATES, depends=DEPENDS, select=True)
|
||||
category = fields.Many2One(
|
||||
string='Category',
|
||||
string='Category', select=True,
|
||||
model_name='cashbook.category', ondelete='RESTRICT',
|
||||
states={
|
||||
'readonly': STATES['readonly'],
|
||||
|
@ -63,7 +63,7 @@ class SplitLine(SecondCurrencyMixin, ModelSQL, ModelView):
|
|||
('owner.id', '=', Eval('owner_cashbook', -1)),
|
||||
('id', '!=', Eval('cashbook', -1)),
|
||||
('btype', '!=', None),
|
||||
],
|
||||
], select=True,
|
||||
states={
|
||||
'readonly': STATES['readonly'],
|
||||
'invisible': Eval('splittype', '') != 'tr',
|
||||
|
@ -110,25 +110,6 @@ class SplitLine(SecondCurrencyMixin, ModelSQL, ModelView):
|
|||
states={'invisible': True}, model_name='res.user'),
|
||||
'on_change_with_owner_cashbook')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(SplitLine, cls).__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_indexes.update({
|
||||
Index(
|
||||
t,
|
||||
(t.line, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.splittype, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.category, Index.Equality())),
|
||||
Index(
|
||||
t,
|
||||
(t.booktransf, Index.Equality())),
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def default_splittype(cls):
|
||||
""" default category
|
||||
|
|
|
@ -80,7 +80,7 @@ full copyright notices and license terms. -->
|
|||
</record>
|
||||
<record model="ir.rule" id="rg_split_write-1">
|
||||
<field name="domain" eval="['OR',
|
||||
('line.cashbook.owner.id', '=', Eval('user_id', -1)),
|
||||
('line.cashbook.owner.id', '=', Eval('user', {}).get('id', -1)),
|
||||
('line.cashbook.reviewer.id', 'in', Eval('groups', [])),
|
||||
]" pyson="1"/>
|
||||
<field name="rule_group" ref="rg_split_write"/>
|
||||
|
|
|
@ -1,4 +1,16 @@
|
|||
# -*- 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.
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
import trytond.tests.test_tryton
|
||||
import unittest
|
||||
|
||||
from .test_module import CashbookTestCase
|
||||
|
||||
|
||||
__all__ = ['suite']
|
||||
|
||||
|
||||
def suite():
|
||||
suite = trytond.tests.test_tryton.suite()
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(CashbookTestCase))
|
||||
return suite
|
||||
|
|
|
@ -119,8 +119,8 @@ class CategoryTestCase(object):
|
|||
|
||||
self.assertRaisesRegex(
|
||||
UserError,
|
||||
'The value "out" for field "Type" in "Level 1/Level 2" of ' +
|
||||
'"Category" is not valid according to its domain.',
|
||||
'The value for field "Type" in "Category" is not valid ' +
|
||||
'according to its domain.',
|
||||
Category.write,
|
||||
*[
|
||||
[category.childs[0]],
|
||||
|
|
|
@ -895,8 +895,8 @@ class LineTestCase(object):
|
|||
|
||||
self.assertRaisesRegex(
|
||||
UserError,
|
||||
r'The value "Book 1" for field "Cashbook" in "\d+" of ' +
|
||||
r'"Cashbook Line" is not valid according to its domain.',
|
||||
'The value for field "Cashbook" in "Cashbook Line" is not ' +
|
||||
'valid according to its domain.',
|
||||
Line.create,
|
||||
[{
|
||||
'cashbook': book.id,
|
||||
|
|
|
@ -267,10 +267,10 @@ class ValuestoreTestCase(object):
|
|||
# check write of too much digits
|
||||
self.assertRaisesRegex(
|
||||
UserError,
|
||||
r'The number of digits in the value ' +
|
||||
r'"' + r"'12.345'" +
|
||||
r'" for field "Value" in "[Book 1 | 10\.00 usd | ' +
|
||||
r'Open]|balance|12\.35|2" of "Value Store" exceeds ' +
|
||||
r"The number of digits in the value " +
|
||||
r'"Decimal\(' +
|
||||
r"'12\.345'\)" +
|
||||
r'" for field "Value" in "Value Store" exceeds ' +
|
||||
r'the limit of "2".',
|
||||
ValueStore.write,
|
||||
*[
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
[tryton]
|
||||
version=7.0.0
|
||||
version=6.0.35
|
||||
depends:
|
||||
res
|
||||
currency
|
||||
party
|
||||
company
|
||||
irrulecontext
|
||||
xml:
|
||||
icon.xml
|
||||
group.xml
|
||||
|
|
9
types.py
9
types.py
|
@ -3,7 +3,7 @@
|
|||
# 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, Unique, Index
|
||||
from trytond.model import ModelView, ModelSQL, fields, Unique
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.i18n import gettext
|
||||
|
||||
|
@ -19,7 +19,7 @@ class Type(ModelSQL, ModelView):
|
|||
required=True, ondelete="RESTRICT")
|
||||
feature = fields.Selection(
|
||||
string='Feature', required=True,
|
||||
selection='get_sel_feature',
|
||||
selection='get_sel_feature', select=True,
|
||||
help='Select feature set of the Cashbook.')
|
||||
|
||||
@classmethod
|
||||
|
@ -32,11 +32,6 @@ class Type(ModelSQL, ModelView):
|
|||
Unique(t, t.short),
|
||||
'cashbook.msg_type_short_unique'),
|
||||
])
|
||||
cls._sql_indexes.update({
|
||||
Index(
|
||||
t,
|
||||
(t.feature, Index.Equality())),
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def default_feature(cls):
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
from sql.functions import CurrentTimestamp, DateTrunc
|
||||
from sql.aggregate import Count
|
||||
from sql.conditionals import Coalesce
|
||||
from trytond.model import ModelSQL, fields, Unique, Index
|
||||
from trytond.model import ModelSQL, fields, Unique
|
||||
from trytond.pool import Pool
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pyson import Eval, PYSON, PYSONEncoder, PYSONDecoder
|
||||
|
@ -22,7 +22,7 @@ class ValueStore(ModelSQL):
|
|||
cashbook = fields.Many2One(
|
||||
string='Cashbook', required=True, model_name='cashbook.book',
|
||||
ondelete='CASCADE')
|
||||
field_name = fields.Char(string='Field Name', required=True)
|
||||
field_name = fields.Char(string='Field Name', required=True, select=True)
|
||||
numvalue = fields.Numeric(
|
||||
string='Value', digits=(16, Eval('valuedigits', 6)),
|
||||
depends=['valuedigits'])
|
||||
|
@ -49,11 +49,6 @@ class ValueStore(ModelSQL):
|
|||
Unique(t, t.cashbook, t.field_name),
|
||||
'cashbook.msg_value_exists_in_store'),
|
||||
])
|
||||
cls._sql_indexes.update({
|
||||
Index(
|
||||
t,
|
||||
(t.field_name, Index.Equality())),
|
||||
})
|
||||
|
||||
def get_rec_name(self, name):
|
||||
""" name, balance, state
|
||||
|
|
|
@ -1 +1 @@
|
|||
irrulecontext;7.0.1;7.0.999;mds
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@ The COPYRIGHT file at the top level of this repository contains the
|
|||
full copyright notices and license terms. -->
|
||||
<tree keyword_open="1">
|
||||
<field name="rec_name" expand="1"/>
|
||||
<field name="balance" sum="1" symbol="currency"/>
|
||||
<field name="balance_all" symbol="currency" optional="1"/>
|
||||
<field name="balance_ref" symbol="company_currency" optional="1"/>
|
||||
<field name="state" optional="0"/>
|
||||
<field name="balance" sum="Balance" symbol="currency"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
|
|
|
@ -5,9 +5,7 @@ full copyright notices and license terms. -->
|
|||
<tree keyword_open="1" tree_state="1">
|
||||
<field name="name" expand="1"/>
|
||||
<field name="balance" symbol="currency"/>
|
||||
<field name="balance_all" symbol="currency" optional="1"/>
|
||||
<field name="balance_ref" symbol="company_currency" optional="1"/>
|
||||
<field name="state" optional="0"/>
|
||||
<field name="state"/>
|
||||
<field name="parent" tree_invisible="1"/>
|
||||
<field name="childs" tree_invisible="1"/>
|
||||
</tree>
|
||||
|
|
|
@ -4,14 +4,14 @@ The COPYRIGHT file at the top level of this repository contains the
|
|||
full copyright notices and license terms. -->
|
||||
<tree>
|
||||
<field name="cashbook" tree_invisible="1"/>
|
||||
<field name="number" optional="0"/>
|
||||
<field name="number"/>
|
||||
<field name="date"/>
|
||||
<field name="payee"/>
|
||||
<field name="category_view"/>
|
||||
<field name="descr_short" expand="1"/>
|
||||
<field name="credit" sum="1" optional="0"/>
|
||||
<field name="debit" sum="1" optional="0"/>
|
||||
<field name="balance" optional="0"/>
|
||||
<field name="state" optional="0"/>
|
||||
<field name="credit" sum="Credit"/>
|
||||
<field name="debit" sum="Debit"/>
|
||||
<field name="balance"/>
|
||||
<field name="state"/>
|
||||
<button name="wfcheck"/>
|
||||
</tree>
|
||||
|
|
|
@ -4,13 +4,13 @@ The COPYRIGHT file at the top level of this repository contains the
|
|||
full copyright notices and license terms. -->
|
||||
<tree>
|
||||
<field name="cashbook" tree_invisible="1"/>
|
||||
<field name="number" optional="0"/>
|
||||
<field name="date" optional="0"/>
|
||||
<field name="payee" optional="0"/>
|
||||
<field name="category_view" optional="0"/>
|
||||
<field name="descr_short" expand="1" optional="0"/>
|
||||
<field name="credit" sum="1" optional="0"/>
|
||||
<field name="debit" sum="1" optional="0"/>
|
||||
<field name="state" optional="0"/>
|
||||
<field name="number"/>
|
||||
<field name="date"/>
|
||||
<field name="payee"/>
|
||||
<field name="category_view"/>
|
||||
<field name="descr_short" expand="1"/>
|
||||
<field name="credit" sum="Credit"/>
|
||||
<field name="debit" sum="Debit"/>
|
||||
<field name="state"/>
|
||||
<button name="wfrecon"/>
|
||||
</tree>
|
||||
|
|
|
@ -4,11 +4,11 @@ The COPYRIGHT file at the top level of this repository contains the
|
|||
full copyright notices and license terms. -->
|
||||
<tree>
|
||||
<field name="cashbook"/>
|
||||
<field name="date" optional="0"/>
|
||||
<field name="date_from" optional="0"/>
|
||||
<field name="date_to" optional="0"/>
|
||||
<field name="start_amount" optional="0"/>
|
||||
<field name="end_amount" optional="0"/>
|
||||
<field name="lines" optional="0"/>
|
||||
<field name="state" optional="0"/>
|
||||
<field name="date"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="start_amount"/>
|
||||
<field name="end_amount"/>
|
||||
<field name="lines"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
|
|
|
@ -8,7 +8,7 @@ full copyright notices and license terms. -->
|
|||
<field name="splittype"/>
|
||||
<field name="category"/>
|
||||
<field name="booktransf"/>
|
||||
<field name="description" expand="1" optional="0"/>
|
||||
<field name="amount" sum="1" symbol="currency" optional="0"/>
|
||||
<field name="amount_2nd_currency" symbol="currency2nd" optional="0"/>
|
||||
<field name="description" expand="1"/>
|
||||
<field name="amount" sum="Amount" symbol="currency"/>
|
||||
<field name="amount_2nd_currency" symbol="currency2nd"/>
|
||||
</tree>
|
||||
|
|
Loading…
Reference in a new issue