Added the "accounting.utils.cast" module to cast the things to the expected type in order to supress the warnings from PyCharm.

This commit is contained in:
2023-03-15 01:06:15 +08:00
parent 4c84686395
commit e9d8a8fcd8
7 changed files with 73 additions and 22 deletions

View File

@ -32,6 +32,7 @@ from accounting.report.utils.base_report import BaseReport
from accounting.report.utils.csv_export import csv_download
from accounting.report.utils.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.utils.cast import be
from accounting.utils.pagination import Pagination
from accounting.utils.query import parse_query_keywords
from .journal import get_csv_rows
@ -124,7 +125,7 @@ class EntryCollector:
try:
txn_date = datetime.strptime(k, "%Y")
conditions.append(
sa.extract("year", Transaction.date) == txn_date.year)
be(sa.extract("year", Transaction.date) == txn_date.year))
except ValueError:
pass
try: