transaktion: check für fehlende kategorie

This commit is contained in:
Frederik Jaeckel 2022-09-08 11:20:28 +02:00
parent 79620f8cbb
commit 18093219a8
3 changed files with 15 additions and 0 deletions

View file

@ -54,6 +54,10 @@ msgctxt "model:ir.message,text:msg_wiz_transactions_error"
msgid "When reading the QIF file, there were the following problems:"
msgstr "Beim Einlesen der QIF-Datei gab es folgende Probleme:"
msgctxt "model:ir.message,text:mds_import_no_category"
msgid "No category has been assigned for transaction '%(trdata)s'."
msgstr "Für die Transaktion '%(trdata)s' wurde keine Kategorie zugeordnet."
#############
# ir.action #

View file

@ -41,6 +41,9 @@ full copyright notices and license terms. -->
<record model="ir.message" id="mds_import_address">
<field name="text">Address</field>
</record>
<record model="ir.message" id="mds_import_no_category">
<field name="text">No category has been assigned for transaction '%(trdata)s'.</field>
</record>
</data>
</tryton>

View file

@ -400,6 +400,14 @@ class QifTool(Model):
if 'splitlines' in line.keys():
line['state'] = 'edit'
# check data
if line['bookingtype'] in ['in', 'out']:
if line.get('category', None) is None:
msg_list.append(gettext(
'cashbook_dataexchange.mds_import_no_category',
trdata = str(transaction)))
fail_cnt += 1
to_create.append(line)
return (to_create, msg_list, fail_cnt)