line: funktion für 'balance' + test
reconciliation: rec_name + test
This commit is contained in:
parent
f86db6dea3
commit
fd36a3f4ce
6 changed files with 206 additions and 3 deletions
15
line.py
15
line.py
|
@ -5,7 +5,7 @@
|
|||
|
||||
from decimal import Decimal
|
||||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.pool import PoolMeta, Pool
|
||||
from trytond.pyson import Eval, Or, If
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
|
@ -106,6 +106,19 @@ class Line(metaclass=PoolMeta):
|
|||
result['quantity'] = line.quantity
|
||||
return result
|
||||
|
||||
@fields.depends('id', 'date', 'cashbook', \
|
||||
'_parent_cashbook.id', 'reconciliation', \
|
||||
'_parent_reconciliation.start_quantity',\
|
||||
'_parent_reconciliation.state')
|
||||
def on_change_with_quantity_balance(self, name=None):
|
||||
""" get quantity-balance
|
||||
"""
|
||||
Line2 = Pool().get('cashbook.line')
|
||||
return Line2.get_balance_of_line(self,
|
||||
field_name='quantity',
|
||||
credit_name='quantity_credit',
|
||||
debit_name='quantity_debit')
|
||||
|
||||
@fields.depends('quantity', 'amount', 'currency_digits', 'quantity_digits')
|
||||
def on_change_with_asset_rate(self, name=None):
|
||||
""" get rate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue