formatting
This commit is contained in:
parent
aed948fb8a
commit
faefea3b5f
4 changed files with 17 additions and 6 deletions
9
asset.py
9
asset.py
|
@ -15,6 +15,7 @@ from sql.functions import CurrentDate, CurrentTimestamp, Round, Extract
|
|||
from sql.conditionals import Case, Coalesce, NullIf
|
||||
from sql import Literal
|
||||
from .diagram import Concat2
|
||||
from .const import DEF_NONE
|
||||
|
||||
|
||||
digits_percent = 2
|
||||
|
@ -100,8 +101,8 @@ class Asset(SymbolMixin, ModelSQL, ModelView):
|
|||
string='URL',
|
||||
help='URL for data retrieval.',
|
||||
states={
|
||||
'invisible': Eval('updturl_enable', False) == False,
|
||||
'required': Eval('updturl_enable', False) == True,
|
||||
'invisible': ~Eval('updturl_enable', False),
|
||||
'required': Eval('updturl_enable', False),
|
||||
}, depends=['updturl_enable'])
|
||||
updturl_enable = fields.Function(fields.Boolean(
|
||||
string='URL required', readonly=True,
|
||||
|
@ -191,7 +192,7 @@ class Asset(SymbolMixin, ModelSQL, ModelView):
|
|||
query = tab_asset.select(
|
||||
tab_asset.id,
|
||||
tab_asset.updtsource,
|
||||
where=tab_asset.updtsource != None,
|
||||
where=tab_asset.updtsource != DEF_NONE,
|
||||
)
|
||||
cursor.execute(*query)
|
||||
records = cursor.fetchall()
|
||||
|
@ -838,7 +839,7 @@ class Asset(SymbolMixin, ModelSQL, ModelView):
|
|||
).select(
|
||||
tab_asset.id,
|
||||
where=Operator(field_qu, clause[2]) &
|
||||
(field_qu != None),
|
||||
(field_qu != DEF_NONE),
|
||||
)
|
||||
|
||||
return [('id', 'in', query)]
|
||||
|
|
8
const.py
Normal file
8
const.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
# -*- 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.
|
||||
|
||||
|
||||
DEF_TRUE = True
|
||||
DEF_NONE = None
|
|
@ -173,7 +173,8 @@ class ImportWizard(Wizard):
|
|||
datefmt='dd%sdd' % dec_divider,
|
||||
colnr='2'))
|
||||
|
||||
if isinstance(date_val, date) and isinstance(rate_val, Decimal):
|
||||
if isinstance(date_val, date) and isinstance(
|
||||
rate_val, Decimal):
|
||||
result.append({'date': date_val, 'rate': rate_val})
|
||||
|
||||
# date range
|
||||
|
|
|
@ -86,7 +86,8 @@ class OnlineSource(ModelSQL, ModelView):
|
|||
states=STATES_WEB, depends=DEPENDS_WEB)
|
||||
rgxdecimal = fields.Selection(
|
||||
string='Decimal Separator',
|
||||
help='Decimal separator for converting the market value into a number.',
|
||||
help='Decimal separator for converting the market ' +
|
||||
'value into a number.',
|
||||
selection=sel_rgxdecimal, states=STATES_WEB, depends=DEPENDS_WEB)
|
||||
rgxident = fields.Char(
|
||||
string='Identifier',
|
||||
|
|
Loading…
Reference in a new issue