mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 792157 - Cannot create account with different currency
Restore force-insert logic that had gotten lost in the C++ conversion.
This commit is contained in:
parent
c58b0024c5
commit
a4399ee732
@ -217,8 +217,8 @@ GncSqlCommodityBackend::commit (GncSqlBackend* sql_be, QofInstance* inst)
|
||||
g_return_val_if_fail (sql_be != NULL, FALSE);
|
||||
g_return_val_if_fail (inst != NULL, FALSE);
|
||||
g_return_val_if_fail (GNC_IS_COMMODITY (inst), FALSE);
|
||||
|
||||
return do_commit_commodity (sql_be, inst, FALSE);
|
||||
auto in_be = instance_in_db(sql_be, inst);
|
||||
return do_commit_commodity (sql_be, inst, !in_be);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
|
@ -811,6 +811,8 @@ GncSqlBackend::object_in_db (const char* table_name, QofIdTypeConst obj_name,
|
||||
|
||||
/* WHERE */
|
||||
PairVec values{get_object_values(obj_name, pObject, table)};
|
||||
/* We want only the first item in the table, which should be the PK. */
|
||||
values.resize(1);
|
||||
stmt->add_where_cond(obj_name, values);
|
||||
auto result = execute_select_statement (stmt);
|
||||
return (result != nullptr && result->size() > 0);
|
||||
|
Loading…
Reference in New Issue
Block a user