'Can't update record in odoo table

I'm trying to update a record in odoo table. I first get field mapping of the table

customersFieldList = (Map<String, Map<String, Object>>)models.execute("execute_kw", asList(
                db, uid, password,
                "nbp.contracts", "fields_get",
                emptyList(),
                new HashMap() {{
                    put("attributes", asList("string", "help", "type"));
                }}
        ));

After that i try to update "phone" field, that is present in the field list. Here's the field that i'm trying to update (that comes from the response of the API call)

...
phone={string=Phone, type=char},
...

But when i try to update the record

 models.execute("execute_kw", asList(
                db, uid, password,
                "nbp.contracts", "write",
                asList(
                        asList(i),
                        new HashMap() {{ put("phone", "3937612052"); }}
                )
        ));

I'll get TypeError: cannot marshal <class '_thread.lock'> objects

Any suggestion? Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source