LinkOrUnlinkOperation must not be done on meta operations

This commit is contained in:
Grégory Soutadé 2017-10-05 19:05:55 +02:00
parent 61e2a7505c
commit 53ecc806a7
2 changed files with 5 additions and 4 deletions

View File

@ -310,7 +310,6 @@ int KissCount::GenerateMonth(int monthFrom, int yearFrom, int monthTo, int yearT
op.checked = false;
op.id = AddOperation(op);
op.childs.clear();
op._virtual = false;
if (op.meta)
meta[it->id] = op.id;

View File

@ -495,6 +495,8 @@ void Database::LinkOrUnlinkOperation(User* user, Operation& op)
bool _virtual;
QSqlQuery query(_db);
if (op.meta) return;
account = user->GetAccount(op.account);
if (op.transfert)
@ -533,12 +535,12 @@ void Database::LinkOrUnlinkOperation(User* user, Operation& op)
EXECUTE_SQL_QUERY(req, );
// Don't need to link
if (!query.next()) return ;
if (!query.next()) return ;
set = query.record();
set = query.record();
// Link
linked.id = set.value("id").toInt();
linked.id = set.value("id").toInt();
op.transfert = linked.id;