Compare commits
77 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bb8c245037 | ||
![]() |
713c8a0d63 | ||
![]() |
6b3ff4eb9f | ||
![]() |
f173dee817 | ||
![]() |
d8ff106f48 | ||
![]() |
d696af8886 | ||
![]() |
49045c8596 | ||
![]() |
b9dbaf0cf9 | ||
![]() |
d23c53b047 | ||
![]() |
f0072a670c | ||
![]() |
86ba1b0bf1 | ||
![]() |
bd7a41d9fa | ||
![]() |
114c6d1f9b | ||
![]() |
e16717959b | ||
![]() |
0761d71e29 | ||
![]() |
b3733c5c7f | ||
![]() |
428ffb20b5 | ||
![]() |
186b64e4b9 | ||
![]() |
f3f0508821 | ||
![]() |
cce59eb8bf | ||
![]() |
a7dda40f43 | ||
![]() |
0cc4ce05f1 | ||
![]() |
3793efc161 | ||
![]() |
6495e0317e | ||
![]() |
b84d7ea0fb | ||
![]() |
177dec2d7d | ||
![]() |
4620f5aad2 | ||
![]() |
7c67fb6de7 | ||
![]() |
38e9477286 | ||
![]() |
dcb746a56b | ||
![]() |
0332dd807e | ||
![]() |
a9b8f5552c | ||
![]() |
882b8d2025 | ||
![]() |
20c3cd5ed5 | ||
![]() |
6c5be8df2d | ||
![]() |
e6bb17f517 | ||
![]() |
19e4a26676 | ||
![]() |
3512e87f71 | ||
![]() |
f0114b6f09 | ||
![]() |
1e1e7d6b85 | ||
![]() |
2b9a2ba07a | ||
![]() |
009f44816e | ||
![]() |
d6ddb7a7d7 | ||
![]() |
e364560d0a | ||
![]() |
8e5a730b36 | ||
![]() |
56961d2ea5 | ||
![]() |
83950fc23a | ||
![]() |
f9892379b1 | ||
![]() |
242f6d9578 | ||
![]() |
2176b84d52 | ||
![]() |
4e118afffb | ||
![]() |
6ab88d9fb5 | ||
![]() |
32eac5aa6c | ||
![]() |
a47057900a | ||
![]() |
9287db67ed | ||
![]() |
5aad26da71 | ||
![]() |
71cdadb8ad | ||
![]() |
d820fc7109 | ||
![]() |
c70d2fef7a | ||
![]() |
43c9a1a2fa | ||
![]() |
a7a9f9ef3d | ||
![]() |
85d385901f | ||
![]() |
cb81f788d6 | ||
![]() |
e65c961e61 | ||
![]() |
e8d69b64ae | ||
![]() |
6b630b7c20 | ||
![]() |
9f12861b79 | ||
![]() |
934d0fb207 | ||
![]() |
9edd2d4a95 | ||
![]() |
3243fbf844 | ||
![]() |
c9d6bf21a5 | ||
![]() |
a315f4e768 | ||
![]() |
674f72476e | ||
![]() |
12e088f79a | ||
![]() |
bbf94c95df | ||
![]() |
29b74d0600 | ||
![]() |
269e744b8f |
13 changed files with 101 additions and 62 deletions
68
README.rst
68
README.rst
|
@ -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
19
book.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 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() + [
|
||||
|
|
3
line.py
3
line.py
|
@ -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',
|
||||
|
|
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 = []
|
||||
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=7.0.0
|
||||
version=6.0.14
|
||||
depends:
|
||||
cashbook
|
||||
investment
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue