formatting

This commit is contained in:
Frederik Jaeckel 2023-12-01 13:29:46 +01:00
parent 1a55e9fa7e
commit 34fa28eeb9
4 changed files with 17 additions and 6 deletions

View file

@ -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,
@ -176,7 +177,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()
@ -823,7 +824,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
View 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

View file

@ -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

View file

@ -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',