• Resolved nixda

    (@nixda)


    Hi there

    First many thanks for this miraculous plugin to sync forms to an API.

    We have an internal only website where we have a Contacts Form 7 form which we want to create leads in our Odoo CRM. The connection works, I created a new form via the template (small typo there on the tab odoo -> Add Bridge “use tempalte”) but unfortunately it throws an error on odoo:

    2025-04-22 13:04:24,766 27744 ERROR myinstance odoo.http: Exception during request handling. 
    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/odoo/models.py", line 6049, in _update_cache
    field_values = [(fields[name], value) for name, value in values.items() if name != 'id']
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/odoo/models.py", line 6049, in <listcomp>
    field_values = [(fields[name], value) for name, value in values.items() if name != 'id']
    ~~~~~~^^^^^^
    KeyError: 'is_company'

    and further down:

    [...]  
    File "/usr/lib/python3/dist-packages/odoo/models.py", line 6497, in new
    record._update_cache(values, validate=False)
    File "/usr/lib/python3/dist-packages/odoo/models.py", line 6051, in _update_cache
    raise ValueError("Invalid field %r on model %r" % (e.args[0], self._name))
    ValueError: Invalid field 'is_company' on model 'crm.lead'

    On the other hand I can successfully create a new contact with a different form (from the template) so it must be a problem with the view when creating a new lead.

    The problem appears on all three templates for Lead creation.

    Many thanks for a hint on how to fix this, I’ll be happy to provide more information.

    -dan

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Còdec

    (@codeccoop)

    Hi Dan,

    First of all, the plugin is in development, get it as a beta! We’ve released it to test it on real situations like this, so you are very welcome.

    Second, we’ve released a patch to the version 3.3 of Forms Bridge with the fix of the bug your are reporting, included the typo, many thanks 🤗. Try to update the plugin to the version 3.3.1 and try again. If we don’t have more feedback, we will assume the issue is fixed, otherwise, please, reopen this thread.

    On the other hand, the Odoo JSON-RPC API its complicated: Odoo is modular and models are extended based on the active modules. This is not well resolved by Forms Bread, we know it. We’ve made tests with Odoo 18 and the CRM and Invoicing modules activated and it works fine, but with other configurations some bridges may fail. We are working on a page with documentation to explain it!

    Thread Starter nixda

    (@nixda)

    Fabulous. Thanks for your swift reply and fix: It is indeed working now.

    Keep on the good work!

    Best, -dan

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Create Lead fails with KeyError: ‘is_company’’ is closed to new replies.