Compare commits

..

77 commits
main ... 6.0

Author SHA1 Message Date
Frederik Jaeckel
bb8c245037 Etikett ver 6.0.14 zum Änderungssatz 17e045a24b9c hinzugefügt 2024-01-20 18:39:42 +01:00
Frederik Jaeckel
713c8a0d63 Version 6.0.14 2024-01-20 18:39:30 +01:00
Frederik Jaeckel
6b3ff4eb9f merge... 2024-01-20 18:34:01 +01:00
Frederik Jaeckel
f173dee817 fix amounts on view-cashbooks to include non-asset-cashbooks 2024-01-20 18:15:31 +01:00
Frederik Jaeckel
d8ff106f48 Etikett ver 6.0.13 zum Änderungssatz 15212caabe0d hinzugefügt 2024-01-03 22:06:48 +01:00
Frederik Jaeckel
d696af8886 Version 6.0.13 2024-01-03 22:06:35 +01:00
Frederik Jaeckel
49045c8596 fix sorting/searcher of field 'yield_balance' 2024-01-03 21:38:33 +01:00
Frederik Jaeckel
b9dbaf0cf9 Etikett ver 6.0.12 zum Änderungssatz 8f45f63b7ee4 hinzugefügt 2023-12-31 13:45:28 +01:00
Frederik Jaeckel
d23c53b047 Version 6.0.12 2023-12-31 13:45:17 +01:00
Frederik Jaeckel
f0072a670c add license 2023-12-31 11:23:22 +01:00
Frederik Jaeckel
86ba1b0bf1 add sorting 2023-12-30 11:44:33 +01:00
Frederik Jaeckel
bd7a41d9fa add update of cashbooks on update of asset-rates 2023-12-30 10:57:17 +01:00
Frederik Jaeckel
114c6d1f9b cashbook: optimize for speed for checking rows 2023-12-29 23:09:00 +01:00
Frederik Jaeckel
e16717959b add worker-based precalculation of cashbook-values 2023-12-29 23:07:39 +01:00
Frederik Jaeckel
0761d71e29 remove caching 2023-12-23 10:44:55 +01:00
Frederik Jaeckel
b3733c5c7f fix DEF_NONE 2023-12-06 22:06:18 +01:00
Frederik Jaeckel
428ffb20b5 Etikett ver 6.0.11 zum Änderungssatz c87683b82288 hinzugefügt 2023-12-06 21:59:15 +01:00
Frederik Jaeckel
186b64e4b9 Version 6.0.11 2023-12-06 21:58:58 +01:00
Frederik Jaeckel
f3f0508821 tests: formatting 2023-12-03 17:37:43 +01:00
Frederik Jaeckel
cce59eb8bf formatting 2023-12-03 17:31:42 +01:00
Frederik Jaeckel
a7dda40f43 Etikett ver 6.0.10 zum Änderungssatz 2c7377b88a5a hinzugefügt 2023-06-08 17:18:58 +02:00
Frederik Jaeckel
0cc4ce05f1 Version 6.0.10 2023-06-08 17:18:43 +02:00
Frederik Jaeckel
3793efc161 tests: add company to context 2023-06-08 16:00:36 +02:00
Frederik Jaeckel
6495e0317e tests: formatting 2023-06-08 14:34:56 +02:00
Frederik Jaeckel
b84d7ea0fb formatting 2023-06-08 14:00:59 +02:00
Frederik Jaeckel
177dec2d7d Etikett ver 6.0.9 zum Änderungssatz 783aaee66f11 hinzugefügt 2023-04-19 09:45:04 +02:00
Frederik Jaeckel
4620f5aad2 Version 6.0.9 2023-04-19 09:44:56 +02:00
Frederik Jaeckel
7c67fb6de7 line: formatting, fix - on_change_with_quantity_digits() 2023-04-19 09:43:29 +02:00
Frederik Jaeckel
38e9477286 Etikett ver 6.0.8 zum Änderungssatz db9ce46e07e5 hinzugefügt 2023-04-17 12:03:36 +02:00
Frederik Jaeckel
dcb746a56b Version 6.0.8 2023-04-17 12:03:26 +02:00
Frederik Jaeckel
0332dd807e line: selection of digits for quantity 2023-04-17 12:01:51 +02:00
Frederik Jaeckel
a9b8f5552c Etikett ver 6.0.7 zum Änderungssatz 2f73b961caf1 hinzugefügt 2023-03-05 10:30:38 +01:00
Frederik Jaeckel
882b8d2025 Version 6.0.7 2023-03-05 10:30:30 +01:00
Frederik Jaeckel
20c3cd5ed5 remove logging, add trytond.conf-settings 2023-03-05 10:26:39 +01:00
Frederik Jaeckel
6c5be8df2d book: optimize query for speed 2023-03-04 21:21:54 +01:00
Frederik Jaeckel
e6bb17f517 readme 2023-02-28 09:22:09 +01:00
Frederik Jaeckel
19e4a26676 fix: import + no symbol if None 2023-02-27 21:17:48 +01:00
Frederik Jaeckel
3512e87f71 Etikett ver 6.0.6 zum Änderungssatz 3f4bf4551378 hinzugefügt 2023-02-27 20:50:28 +01:00
Frederik Jaeckel
f0114b6f09 Version 6.0.6 2023-02-27 20:50:19 +01:00
Frederik Jaeckel
1e1e7d6b85 book:caching for line, settings: cache clear 2023-02-27 20:46:41 +01:00
Frederik Jaeckel
2b9a2ba07a book: add cache for asset-rates 2023-02-27 10:20:23 +01:00
Frederik Jaeckel
009f44816e book: new field 'purchase_amount', optimize form
speedup: indexes, caching
2023-02-26 22:51:24 +01:00
Frederik Jaeckel
d6ddb7a7d7 line: fix exception if missing config; book: optimize form 2023-02-23 10:35:30 +01:00
Frederik Jaeckel
e364560d0a book: optimized field 'yield_balance' 2023-02-22 21:24:58 +01:00
Frederik Jaeckel
8e5a730b36 book: added fields to book-form 2023-02-22 20:33:12 +01:00
Frederik Jaeckel
56961d2ea5 cashbook: yield-info prepared 2023-02-22 16:21:23 +01:00
Frederik Jaeckel
83950fc23a line: add help, fix form 2023-02-21 22:36:20 +01:00
Frederik Jaeckel
f9892379b1 line: tests... ok 2023-02-21 22:22:23 +01:00
Frederik Jaeckel
242f6d9578 line: field 'trade_fee' ok + test 2023-02-21 12:57:10 +01:00
Frederik Jaeckel
2176b84d52 line: fee tests ergänzt 2023-02-20 23:22:31 +01:00
Frederik Jaeckel
4e118afffb line: field 'asset_gainloss' ok + test 2023-02-18 20:55:04 +01:00
Frederik Jaeckel
6ab88d9fb5 line: gain/loss ok + test 2023-02-17 10:20:06 +01:00
Frederik Jaeckel
32eac5aa6c line: gain/loss field ... 2023-02-16 23:12:48 +01:00
Frederik Jaeckel
a47057900a line: updated get_gainloss_data_sql + todos 2023-02-16 16:59:50 +01:00
Frederik Jaeckel
9287db67ed add: field 'asset_gainloss' + searcher + test +todos 2023-02-15 22:34:52 +01:00
Frederik Jaeckel
5aad26da71 add: query for gain/loss 2023-02-14 23:03:12 +01:00
Frederik Jaeckel
71cdadb8ad line: negate amount if splitline=spout - tests 2023-02-14 22:27:25 +01:00
Frederik Jaeckel
d820fc7109 field trade_fee + asset_dividend ok + searcher + test 2023-02-12 22:01:07 +01:00
Frederik Jaeckel
c70d2fef7a line: add fields 'Fee' + 'Dividend' - todos 2023-02-12 00:09:56 +01:00
Frederik Jaeckel
43c9a1a2fa Etikett ver 6.0.5 zum Änderungssatz f0356df3abb0 hinzugefügt 2023-02-05 18:10:07 +01:00
Frederik Jaeckel
a7a9f9ef3d Version 6.0.5 2023-02-05 18:10:00 +01:00
Frederik Jaeckel
85d385901f line: fix write() - get 'bookingtype' from line if not in values 2023-02-05 11:35:55 +01:00
Frederik Jaeckel
cb81f788d6 Etikett ver 6.0.4 zum Änderungssatz 96f6e52d1e14 hinzugefügt 2023-02-01 14:51:54 +01:00
Frederik Jaeckel
e65c961e61 Version 6.0.4 2023-02-01 14:51:47 +01:00
Frederik Jaeckel
e8d69b64ae line/splitline: fixed selection of quantity-uom/digits 2023-02-01 14:29:48 +01:00
Frederik Jaeckel
6b630b7c20 Etikett ver 6.0.3 zum Änderungssatz 62e4472ad4a2 hinzugefügt 2023-01-30 09:27:52 +01:00
Frederik Jaeckel
9f12861b79 Version 6.0.3 2023-01-30 09:27:44 +01:00
Frederik Jaeckel
934d0fb207 reconciliation: use 'quantity_digits' for digits of start/end-quantity 2023-01-30 09:25:44 +01:00
Frederik Jaeckel
9edd2d4a95 line: add performance values to line-form 2023-01-29 23:16:22 +01:00
Frederik Jaeckel
3243fbf844 Etikett ver 6.0.2 zum Änderungssatz ae7678260358 hinzugefügt 2023-01-28 13:13:20 +01:00
Frederik Jaeckel
c9d6bf21a5 Version 6.0.2 2023-01-28 13:13:14 +01:00
Frederik Jaeckel
a315f4e768 cashbook: view current_value/-ref on chasbooks with btype=None if
asset-cashbooks are below
2023-01-28 13:03:24 +01:00
Frederik Jaeckel
674f72476e book: asset-query ausgelagert 2023-01-24 21:25:29 +01:00
Frederik Jaeckel
12e088f79a line: fix transfer between cash-/asset-book with zero quantity 2023-01-23 22:29:41 +01:00
Frederik Jaeckel
bbf94c95df line: fix rec_name 2023-01-22 10:28:09 +01:00
Frederik Jaeckel
29b74d0600 Etikett ver 6.0.1 zum Änderungssatz 67d3f883961c hinzugefügt 2023-01-21 19:18:44 +01:00
Frederik Jaeckel
269e744b8f Version 6.0.1 2023-01-21 19:18:36 +01:00
13 changed files with 101 additions and 62 deletions

View file

@ -9,7 +9,7 @@ pip install mds-cashbook-investment
Requires
========
- Tryton 7.0
- Tryton 6.0
How to
======
@ -23,6 +23,68 @@ You can monitor trading fees, dividends and sales profits.
Changes
=======
*7.0.0 - 06.12.2023*
*6.0.14 - 19.01.2024*
- compatibility to Tryton 7.0
- the amounts of the view cash books now include the amounts
of the generic cash books
*6.0.13 - 03.01.2024*
- fix: sorting/searcher of field yield-balance
*6.0.12 - 31.12.2023*
- remove caching
- add worker-based precalculation of cashbook-values
*6.0.11 - 06.12.2023*
- code optimized
*6.0.10 - 08.06.2023*
- code optimized
*6.0.9 - 19.04.2023*
- fix: line - exception if add split-lines
*6.0.8 - 17.04.2023*
- fix: line - selection of digits for quantity
*6.0.7 - 05.03.2023*
- updt: optimize queries for speed, optimize caching
- add: trytond.conf-settings
*6.0.6 - 27.02.2023*
- add: caching
- add: performance and yield info
*6.0.5 - 05.02.2023*
- fix: line rewrite values
*6.0.4 - 01.02.2023*
- fix: selection of quantity-uom/digits on line/spitline
*6.0.3 - 30.01.2023*
- add: performance-tab to line-form
- fix: digits of start/end-quantity in reconciliation
*6.0.2 - 28.01.2023*
- fix: transfer between cash-/asset-book with zero quantity
- add: view value/percent on chasbooks with btype=None
*6.0.1 - 21.01.2023*
- works
*6.0.0 - 20.12.2022*
- init

19
book.py
View file

@ -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 fields, SymbolMixin, Index
from trytond.model import fields, SymbolMixin
from trytond.pool import PoolMeta, Pool
from trytond.pyson import Eval, Or, Bool, If
from trytond.modules.cashbook.book import STATES2, DEPENDS2
@ -25,7 +25,7 @@ class Book(SymbolMixin, metaclass=PoolMeta):
__name__ = 'cashbook.book'
asset = fields.Many2One(
string='Asset',
string='Asset', select=True,
model_name='investment.asset', ondelete='RESTRICT',
states={
'required': Eval('feature', '') == 'asset',
@ -51,7 +51,7 @@ class Book(SymbolMixin, metaclass=PoolMeta):
model_name='product.uom.category',
states={'invisible': True}), 'on_change_with_asset_uomcat')
quantity_uom = fields.Many2One(
string='UOM',
string='UOM', select=True,
model_name='product.uom', ondelete='RESTRICT',
domain=[('category.id', '=', Eval('asset_uomcat', -1))],
states={
@ -181,19 +181,6 @@ class Book(SymbolMixin, metaclass=PoolMeta):
depends=['currency_digits', 'feature']),
'get_yield_balance_data', searcher='search_asset_quantity')
@classmethod
def __setup__(cls):
super(Book, cls).__setup__()
t = cls.__table__()
cls._sql_indexes.update({
Index(
t,
(t.asset, Index.Equality())),
Index(
t,
(t.quantity_uom, Index.Equality())),
})
@classmethod
def view_attributes(cls):
return super(Book, cls).view_attributes() + [

View file

@ -14,9 +14,10 @@ from trytond.i18n import gettext
from trytond.report import Report
from trytond.transaction import Transaction
from trytond.modules.cashbook.line import STATES, DEPENDS
from trytond.modules.cashbook.const import DEF_NONE
from .mixin import SecondUomMixin
DEF_NONE = None
STATESQ1 = {
'invisible': And(
Eval('feature', '') != 'asset',

View file

@ -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 = []
@ -92,7 +92,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 investment',

View file

@ -1,2 +1,17 @@
# 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 CashbookInvestmentTestCase
__all__ = ['suite']
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
CashbookInvestmentTestCase))
return suite

View file

@ -828,8 +828,7 @@ class CbInvTestCase(object):
self.assertRaisesRegex(
UserError,
'A value is required for field "Asset" in ' +
'"Book 1 | 0.00 usd | Open | 0.0000 u" of "Cashbook".',
'A value is required for field "Asset" in "Cashbook".',
Book.write,
*[
[book],

View file

@ -1,5 +1,5 @@
[tryton]
version=7.0.0
version=6.0.14
depends:
cashbook
investment

View file

@ -1,2 +1,2 @@
cashbook;7.0.32;7.0.999;mds
investment;7.0.26;7.0.999;mds
cashbook;6.0.33;6.0.999;mds
investment;6.0.26;6.0.999;mds

View file

@ -5,20 +5,9 @@ full copyright notices and license terms. -->
<data>
<xpath expr="/tree/field[@name='balance']" position="after">
<field name="current_value" symbol="currency" optional="0"/>
<field name="current_value_ref" symbol="company_currency" optional="1"/>
<field name="purchase_amount" symbol="currency" optional="1"/>
<field name="diff_amount" symbol="currency" optional="0"/>
<field name="yield_balance" symbol="currency" optional="1"/>
<field name="diff_percent" optional="0"/>
<field name="quantity" symbol="quantity_uom" optional="0"/>
<field name="quantity_all" symbol="quantity_uom" optional="1"/>
<field name="yield_sales" symbol="currency" optional="1"/>
<field name="yield_sales_12m" symbol="currency" optional="1"/>
<field name="yield_dividend_total" symbol="currency" optional="1"/>
<field name="yield_dividend_12m" symbol="currency" optional="1"/>
<field name="yield_fee_total" symbol="currency" optional="1"/>
<field name="yield_fee_12m" symbol="currency" optional="1"/>
<field name="current_value" symbol="currency"/>
<field name="diff_percent"/>
<field name="quantity" symbol="quantity_uom"/>
</xpath>
</data>

View file

@ -5,20 +5,7 @@ full copyright notices and license terms. -->
<data>
<xpath expr="/tree/field[@name='balance']" position="after">
<field name="current_value" symbol="currency" optional="1"/>
<field name="current_value_ref" symbol="company_currency" optional="1"/>
<field name="purchase_amount" symbol="currency" optional="1"/>
<field name="diff_amount" symbol="currency" optional="0"/>
<field name="yield_balance" symbol="currency" optional="1"/>
<field name="diff_percent" optional="0"/>
<field name="quantity" symbol="quantity_uom" optional="1"/>
<field name="quantity_all" symbol="quantity_uom" optional="1"/>
<field name="yield_sales" symbol="currency" optional="1"/>
<field name="yield_sales_12m" symbol="currency" optional="1"/>
<field name="yield_dividend_total" symbol="currency" optional="1"/>
<field name="yield_dividend_12m" symbol="currency" optional="1"/>
<field name="yield_fee_total" symbol="currency" optional="1"/>
<field name="yield_fee_12m" symbol="currency" optional="1"/>
<field name="diff_amount" symbol="currency"/>
</xpath>
</data>

View file

@ -5,9 +5,9 @@ full copyright notices and license terms. -->
<data>
<xpath expr="/tree/field[@name='balance']" position="after">
<field name="quantity_credit" optional="0"/>
<field name="quantity_debit" optional="0"/>
<field name="quantity_balance" optional="0"/>
<field name="quantity_credit"/>
<field name="quantity_debit"/>
<field name="quantity_balance"/>
</xpath>
</data>

View file

@ -5,7 +5,7 @@ full copyright notices and license terms. -->
<data>
<xpath expr="/tree/field[@name='end_amount']" position="after">
<field name="start_quantity" optional="0"/>
<field name="end_quantity" optional="0"/>
<field name="start_quantity"/>
<field name="end_quantity"/>
</xpath>
</data>

View file

@ -5,8 +5,8 @@ full copyright notices and license terms. -->
<data>
<xpath expr="/tree/field[@name='amount_2nd_currency']" position="after">
<field name="quantity" symbol="quantity_uom" optional="0"/>
<field name="quantity_2nd_uom" symbol="quantity2nd" optional="0"/>
<field name="quantity" symbol="quantity_uom"/>
<field name="quantity_2nd_uom" symbol="quantity2nd"/>
</xpath>
</data>