Compare commits
51 commits
ver_6.0.14
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
064fec927e | ||
![]() |
12b5442f19 | ||
![]() |
6d9a5b080d | ||
![]() |
728b2fa6c2 | ||
![]() |
c38737076f | ||
![]() |
4a23e1ae81 | ||
![]() |
49d3a2fec5 | ||
![]() |
ec97351db9 | ||
![]() |
fb062243d6 | ||
![]() |
82c390caae | ||
![]() |
3d0ce89df8 | ||
![]() |
8dafa0bce0 | ||
![]() |
27c12d4ad1 | ||
![]() |
21b014183a | ||
![]() |
1f47dfe6b1 | ||
![]() |
1047345ae8 | ||
![]() |
ad067475f8 | ||
![]() |
6c1fac8672 | ||
![]() |
f7109b013f | ||
![]() |
e96aa6fad7 | ||
![]() |
da7fc9cb65 | ||
![]() |
e244e75d8a | ||
![]() |
6bcb4efc2b | ||
![]() |
17a4499ac7 | ||
![]() |
02bde17f6b | ||
![]() |
91b88a48e5 | ||
![]() |
5e7552e589 | ||
![]() |
f95a9ed710 | ||
![]() |
20f465ae3a | ||
![]() |
91de15e093 | ||
![]() |
6177b5d691 | ||
![]() |
0c60a8c313 | ||
![]() |
9f22341005 | ||
![]() |
fe07c4a17f | ||
![]() |
6b042bca3b | ||
![]() |
313892d2d5 | ||
![]() |
c82f37729b | ||
![]() |
e0a2a0f9cb | ||
![]() |
4e7d2c2ba9 | ||
![]() |
a1ede23740 | ||
![]() |
3243ccc471 | ||
![]() |
798da563ec | ||
![]() |
982f21f06e | ||
![]() |
438035cca2 | ||
![]() |
e38d02ff9d | ||
![]() |
e79c68e75b | ||
![]() |
ea7f114e94 | ||
![]() |
9669a8d85b | ||
![]() |
8156d521de | ||
![]() |
8232f8042d | ||
![]() |
ae8091bbdf |
13 changed files with 62 additions and 101 deletions
68
README.rst
68
README.rst
|
@ -9,7 +9,7 @@ pip install mds-cashbook-investment
|
|||
|
||||
Requires
|
||||
========
|
||||
- Tryton 6.0
|
||||
- Tryton 7.0
|
||||
|
||||
How to
|
||||
======
|
||||
|
@ -23,68 +23,6 @@ You can monitor trading fees, dividends and sales profits.
|
|||
Changes
|
||||
=======
|
||||
|
||||
*6.0.14 - 19.01.2024*
|
||||
*7.0.0 - 06.12.2023*
|
||||
|
||||
- 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
|
||||
- compatibility to Tryton 7.0
|
||||
|
|
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
|
||||
from trytond.model import fields, SymbolMixin, Index
|
||||
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', select=True,
|
||||
string='Asset',
|
||||
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', select=True,
|
||||
string='UOM',
|
||||
model_name='product.uom', ondelete='RESTRICT',
|
||||
domain=[('category.id', '=', Eval('asset_uomcat', -1))],
|
||||
states={
|
||||
|
@ -181,6 +181,19 @@ 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,10 +14,9 @@ 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 = 6
|
||||
major_version = 7
|
||||
minor_version = 0
|
||||
|
||||
requires = []
|
||||
|
@ -92,6 +92,7 @@ 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,17 +1,2 @@
|
|||
# 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,7 +828,8 @@ class CbInvTestCase(object):
|
|||
|
||||
self.assertRaisesRegex(
|
||||
UserError,
|
||||
'A value is required for field "Asset" in "Cashbook".',
|
||||
'A value is required for field "Asset" in ' +
|
||||
'"Book 1 | 0.00 usd | Open | 0.0000 u" of "Cashbook".',
|
||||
Book.write,
|
||||
*[
|
||||
[book],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=6.0.14
|
||||
version=7.0.0
|
||||
depends:
|
||||
cashbook
|
||||
investment
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
cashbook;6.0.33;6.0.999;mds
|
||||
investment;6.0.26;6.0.999;mds
|
||||
cashbook;7.0.32;7.0.999;mds
|
||||
investment;7.0.26;7.0.999;mds
|
||||
|
|
|
@ -5,9 +5,20 @@ full copyright notices and license terms. -->
|
|||
<data>
|
||||
|
||||
<xpath expr="/tree/field[@name='balance']" position="after">
|
||||
<field name="current_value" symbol="currency"/>
|
||||
<field name="diff_percent"/>
|
||||
<field name="quantity" symbol="quantity_uom"/>
|
||||
<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"/>
|
||||
</xpath>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -5,7 +5,20 @@ full copyright notices and license terms. -->
|
|||
<data>
|
||||
|
||||
<xpath expr="/tree/field[@name='balance']" position="after">
|
||||
<field name="diff_amount" symbol="currency"/>
|
||||
<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"/>
|
||||
</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"/>
|
||||
<field name="quantity_debit"/>
|
||||
<field name="quantity_balance"/>
|
||||
<field name="quantity_credit" optional="0"/>
|
||||
<field name="quantity_debit" optional="0"/>
|
||||
<field name="quantity_balance" optional="0"/>
|
||||
</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"/>
|
||||
<field name="end_quantity"/>
|
||||
<field name="start_quantity" optional="0"/>
|
||||
<field name="end_quantity" optional="0"/>
|
||||
</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"/>
|
||||
<field name="quantity_2nd_uom" symbol="quantity2nd"/>
|
||||
<field name="quantity" symbol="quantity_uom" optional="0"/>
|
||||
<field name="quantity_2nd_uom" symbol="quantity2nd" optional="0"/>
|
||||
</xpath>
|
||||
|
||||
</data>
|
||||
|
|
Loading…
Reference in a new issue