Itgenodo047 Odoo Server Error: Database fetch misses ids (('87',)) and has extra ids ((87,)), may be caused by a type incoherence in a previous request (200)

Ik heb een model gemaakt waarbij producten en hun kostprijs opgehaald worden uit Odoo en getoond:

Ik kan de inkoopprijzen muteren en er verschijnt netjes een pending change bij het winkelwagentje.

Echter, bij gebruik van Sync-button verschijnt de volgende foutmelding:

itgenodo047: Odoo Server Error: Database fetch misses ids ((‘87’,)) and has extra ids ((87,)), may be caused by a type incoherence in a previous request (200).
Message ID: d0c86a33-1305-4bdc-bc42-074ace7daf77
Occurred (UTC): 28/06/2023 13:08:16
Invantive.Basics.InvantiveSqlException
bij Invantive.Basics.ValidationException…ctor(GlobalState owner, ExecutionOptions executionOptions, String messageCode, String errorMessage, String kindRequest, String localStackTrace, String nk, Exception innerException, Boolean inheritMessageCodeWhenPresent, Nullable1 uid, Boolean isRecoverable, String poolIdentityId, String url, Nullable1 partyUid)
bij Invantive.Data.Providers.Odoo.OdooExtensionMethods.EnsureSuccessful(Error error, GlobalState owner, ExecutionOptions executionOptions, String messageCode, Root request, String responseJson, ObjectDefinition objectDefinition)
bij Invantive.Data.Providers.Odoo.OdooExtensionMethods.EnsureSuccessful(Root root, GlobalState owner, ExecutionOptions executionOptions, String messageCode, Root request, String responseJson, ObjectDefinition objectDefinition)
bij Invantive.Data.Providers.Odoo.OdooProvider.UpdateReturningMessage(GlobalState owner, ExecutionOptions executionOptions, EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameters, String partition)
bij Invantive.Data.Providers.OData.ODataProvider.HEE(GlobalState , ExecutionOptions , EntityFieldCollection , KeyValuePair`2 , ParameterList )
bij Invantive.Data.Providers.OData.ODataProvider.Update(GlobalState owner, ExecutionOptions executionOptions, EntityFieldCollection entityFields, QueryObject queryObject, ParameterList values, ResultSet sourceContext)
bij Invantive.Data.ConnectionManager.YD(GlobalState , ExecutionOptions , EntityFieldCollection , QueryObject , ParameterList , ResultSet )
bij Invantive.Data.ConnectionManager.Update(GlobalState owner, ExecutionOptions executionOptions, EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameterList, ResultSet sourceContext)
bij Invantive.Data.ActionProceduresBase.PassthroughUpdate(GlobalState owner, ExecutionOptions executionOptions, EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameterList, ResultSet sourceContext)
bij Invantive.Producer.Control.SyncToDatabaseForm.SyncUpload(GlobalState owner, ExecutionOptions executionOptions, DoWorkEventArgs e)
bij Invantive.Producer.Control.SyncToDatabaseForm.syncBackGroundWorker_DoWork(Object sender, DoWorkEventArgs e)
bij System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)

bij Invantive.Data.ConnectionManager.YD(GlobalState , ExecutionOptions , EntityFieldCollection , QueryObject , ParameterList , ResultSet )
bij Invantive.Data.ConnectionManager.Update(GlobalState owner, ExecutionOptions executionOptions, EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameterList, ResultSet sourceContext)
bij Invantive.Data.ActionProceduresBase.PassthroughUpdate(GlobalState owner, ExecutionOptions executionOptions, EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameterList, ResultSet sourceContext)
bij Invantive.Producer.Control.SyncToDatabaseForm.SyncUpload(GlobalState owner, ExecutionOptions executionOptions, DoWorkEventArgs e) in c:\smoke\ws-master\Invantive.Control\src\Invantive.Producer.Control\ThisAddIn.cs:regel 849

Hoe kan ik toch de gewijzigde prijzen uploaden?

Het verzoek aan Odoo was onderwater:

{"id":40,"jsonrpc":"2.0","method":"call","params":{"service":"object","method":"execute_kw","args":["acme-bv",2,"secret","product.template","write",[["87"],[{"Key":"standard_price","Value":[]}]]]}}

Dit is eigenaardig; het veld standard_price in product.template had een waarde moeten meekrijgen zoals de gebruiker heeft ingevoerd.

Een nadere analyse zal uitgevoerd worden.

En het antwoord was:

{"jsonrpc": "2.0", "id": 40, "error": {"code": 200, "message": "Odoo Server Error", "data": {"name": "odoo.exceptions.AccessError", "debug": "Traceback (most recent call last):\n  File \"/home/odoo/src/odoo/14.0/odoo/addons/base/models/ir_http.py\", line 237, in _dispatch\n    result = request.dispatch()\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 696, in dispatch\n    result = self._call_function(**self.params)\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 370, in _call_function\n    return checked_call(self.db, *args, **kwargs)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 94, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 358, in checked_call\n    result = self.endpoint(*a, **kw)\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 919, in __call__\n    return self.method(*args, **kw)\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 544, in response_wrap\n    response = f(*args, **kw)\n  File \"/home/odoo/src/custom/trial/saas_trial/controllers/main.py\", line 275, in jsonrpc\n    res = super(OdooRPC, self).jsonrpc(service, method, args)\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 544, in response_wrap\n    response = f(*args, **kw)\n  File \"/home/odoo/src/odoo/14.0/odoo/addons/base/controllers/rpc.py\", line 96, in jsonrpc\n    return dispatch_rpc(service, method, args)\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 142, in dispatch_rpc\n    result = dispatch(method, params)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 41, in dispatch\n    res = fn(db, uid, *params)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 168, in execute_kw\n    return execute(db, uid, obj, method, *args, **kw or {})\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 94, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 175, in execute\n    res = execute_cr(cr, uid, obj, method, *args, **kw)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 159, in execute_cr\n    result = odoo.api.call_kw(recs, method, args, kw)\n  File \"/home/odoo/src/odoo/14.0/odoo/api.py\", line 399, in call_kw\n    result = _call_kw_multi(method, model, args, kwargs)\n  File \"/home/odoo/src/odoo/14.0/odoo/api.py\", line 386, in _call_kw_multi\n    result = method(recs, *args, **kwargs)\n  File \"/home/odoo/src/odoo/14.0/addons/base_automation/models/base_automation.py\", line 342, in write\n    for old_vals in (records.read(list(vals)) if vals else [])\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 3021, in read\n    self._read(stored_fields)\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 3143, in _read\n    self.check_access_rule('read')\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 3357, in check_access_rule\n    invalid = self - self._filter_access_rules_python(operation)\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 3412, in _filter_access_rules_python\n    return self.sudo().filtered_domain(dom or [])\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 5350, in filtered_domain\n    data = rec.mapped(key)\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 5275, in mapped\n    recs = recs._fields[name].mapped(recs)\n  File \"/home/odoo/src/odoo/14.0/odoo/fields.py\", line 1109, in mapped\n    self.__get__(first(remaining), type(remaining))\n  File \"/home/odoo/src/odoo/14.0/odoo/fields.py\", line 2495, in __get__\n    return super().__get__(records, owner)\n  File \"/home/odoo/src/odoo/14.0/odoo/fields.py\", line 1021, in __get__\n    record._fetch_field(self)\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 3072, in _fetch_field\n    self._read(fnames)\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 3185, in _read\n    raise AccessError(\nException\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 652, in _handle_exception\n    return super(JsonRequest, self)._handle_exception(exception)\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 317, in _handle_exception\n    raise exception.with_traceback(None) from new_cause\nodoo.exceptions.AccessError: Database fetch misses ids (('87',)) and has extra ids ((87,)), may be caused by a type incoherence in a previous request\n", "message": "Database fetch misses ids (('87',)) and has extra ids ((87,)), may be caused by a type incoherence in a previous request", "arguments": ["Database fetch misses ids (('87',)) and has extra ids ((87,)), may be caused by a type incoherence in a previous request"], "context": {}}}}

De rare structuur van de foutmelding met een komma (‘,’) zonder volgende waarde tussen de ronde haken blijkt een Odoo-bug te zijn:

Database fetch misses ids ((‘87’,)) and has extra ids ((87,)), may be caused by a type incoherence in a previous request

Echter, de achterliggende oorzaak is gevonden. Het update-statement werkt wel vanuit Invantive SQL, maar Invantive Control for Excel stuurt de ID van het product om bij te werken door als een tekst:

"1"

in plaats van

1

Dit levert de getoonde Odoo-foutmelding op. Een verbetering zal doorgevoerd worden om de veldwaarde zonder conversie naar tekst aan te bieden.

De oplossing voor deze bug is opgenomen in release 22.1.148, te downloaden vanaf:

https://download.invantive.com/current/Invantive%20Control%20for%20Excel-current.msi

Een uitgebreid voorbeeld voor de synchronisatie van wijzigingen in Excel van en naar Odoo is beschreven in:

Deze vraag is automatisch gesloten na 2 weken inactiviteit. Het laatste gegeven antwoord is gemarkeerd als oplossing.

Gelieve een nieuwe vraag te stellen via een apart topic als het probleem opnieuw optreedt. Gelieve in de nieuwe vraag een link naar dit topic op te nemen door de URL er van in de tekst te plakken.

Dit topic is 7 dagen na het laatste antwoord automatisch gesloten. Nieuwe antwoorden zijn niet meer toegestaan.