# Key error 'company' with account\_fr\_chorus module

**URL:** https://discuss.tryton.org/t/key-error-company-with-account-fr-chorus-module/4626
**Category:** User
**Created:** [September 16, 2021, 8:57am UTC](https://discuss.tryton.org/t/key-error-company-with-account-fr-chorus-module/4626 "2021-09-16T08:57:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![solenepetit](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/c77e96/32.png) [@solenepetit](https://discuss.tryton.org/u/solenepetit)
#### Post date: [September 16, 2021, 8:57am UTC](https://discuss.tryton.org/t/key-error-company-with-account-fr-chorus-module/4626/1 "2021-09-16T08:57:49Z")

</div>

Hello !  
I’m trying to test the usage of the [account\_fr\_chorus module](https://docs.tryton.org/projects/modules-account-fr-chorus/en/latest/).

I followed all the tutorials to use [Chorus Pro qualification service](https://chorus-pro.gouv.fr/qualif/), creating an account, generating test data, creating an account on [AIFE to link Chorus with a PISTE app](https://developer.aife.economie.gouv.fr/), creating a technical account. Then I filled the Chorus section in the Financial configuration of Tryton with the login and password of the technical account, I installed the edocument\_uncefact module to be able to choose CII as Chorus Syntax. I checked the Chorus Pro option for all the parties I registered and I filled in their SIRET. Then I created a customer invoice and I posted it, which has generated a Chorus invoice.

The problem is that the Chorus invoice is apparently not sent to Chorus Pro. I went on the Administration → Scheduler → Actions menu, I selected the “Send invoices to Chorus” method, and when I click on the “Run once” button, I get the following error :

```auto
Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 47, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 156, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 181, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/descriptors.py", line 33, in newfunc
    return self.func(owner, *args, **kwargs)
  File "/trytond/model/modelview.py", line 774, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond_company-6.0.0-py3.8.egg/trytond/modules/company/ir.py", line 111, in run_once
    super(Cron, cls).run_once([cron])
  File "/trytond/model/descriptors.py", line 33, in newfunc
    return self.func(owner, *args, **kwargs)
  File "/trytond/model/modelview.py", line 774, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/ir/cron.py", line 141, in run_once
    getattr(Model, method)()
  File "/trytond/modules/account_fr_chorus/account.py", line 197, in send
    records = cls.search(['OR',
  File "/trytond/model/modelsql.py", line 1273, in search
    tables, expression = cls.search_domain(domain)
  File "/trytond/model/modelsql.py", line 1460, in search_domain
    expression = convert(domain)
  File "/trytond/model/modelsql.py", line 1454, in convert
    return Or((convert(d) for d in domain[1:]))
  File "/trytond/model/modelsql.py", line 1454, in <genexpr>
    return Or((convert(d) for d in domain[1:]))
  File "/trytond/model/modelsql.py", line 1446, in convert
    field = cls._fields[fname]
KeyError: 'company'

```

Has someone already experienced this error ? Do you have some tutorial to help me finish to set up the account\_fr\_chorus module ?  
Thanks for help !

PS : here are the tutorials I followed for the Chorus and AIFE part :

- [Creating an account and test data on Chorus Pro qualification](https://communaute.chorus-pro.gouv.fr/documentation/portail-de-qualification-sur-chorus-pro/)
- [Linking Chorus Pro to an API with a PISTE app](https://communaute.chorus-pro.gouv.fr/documentation/raccordement-a-chorus-pro/)
- [Creating a technical account on Chorus Pro](https://communaute.chorus-pro.gouv.fr/documentation/creation-dun-compte-technique-pour-un-acces-api-en-production/#1507810474441-5a4906aa-1dca)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 16, 2021, 9:05am UTC](https://discuss.tryton.org/t/key-error-company-with-account-fr-chorus-module/4626/2 "2021-09-16T09:05:12Z")

</div>

Please [report an issue](https://www.tryton.org/contribute#bug).

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 16, 2021, 9:05am UTC](https://discuss.tryton.org/t/key-error-company-with-account-fr-chorus-module/4626/3 "2021-09-16T09:05:26Z")

</div>


