# Error when opening invoices

**URL:** <https://discuss.tryton.org/t/error-when-opening-invoices/6929>\
**Category:** User\
**Tags:** sales\
**Created:** [January 30, 2024, 11:59am UTC](https://discuss.tryton.org/t/error-when-opening-invoices/6929 "2024-01-30T11:59:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [January 30, 2024, 11:59am UTC](https://discuss.tryton.org/t/error-when-opening-invoices/6929/1 "2024-01-30T11:59:25Z")

</div>

I’m facing more trouble with invoicing services:  
When trying to post a service invoice (with prices manually filled in before) I get there messages:

```auto
  File "/home/wd/TRYTON/70-realprod/lib/python3.10/site-packages/tryton/gui/window/view_form/view/form.py", line 616, in button_clicked
    self.screen.button(widget.attrs)
  File "/home/wd/TRYTON/70-realprod/lib/python3.10/site-packages/tryton/gui/window/view_form/screen/screen.py", line 1199, in button
    if not record.validate(fields, pre_validate=domain):
  File "/home/wd/TRYTON/70-realprod/lib/python3.10/site-packages/tryton/gui/window/view_form/model/record.py", line 420, in validate
    if not field.validate(self, softvalidation, pre_validate):
  File "/home/wd/TRYTON/70-realprod/lib/python3.10/site-packages/tryton/gui/window/view_form/model/field.py", line 886, in validate
    test = super(O2MField, self).validate(record, softvalidation,
  File "/home/wd/TRYTON/70-realprod/lib/python3.10/site-packages/tryton/gui/window/view_form/model/field.py", line 115, in validate
    unique, leftpart, value = unique_value(
  File "/home/wd/TRYTON/70-realprod/lib/python3.10/site-packages/tryton/common/domain_inversion.py", line 431, in unique_value
    value = value if operator == '=' and single_value else value[0]

TypeError: 'int' object is not subscriptable

```

Hope this helps to narrow down the problem.

Cheers,  
Wolf

---

<div class="post-metadata">

**Author:** ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)\
**Post date:** [January 30, 2024, 1:13pm UTC](https://discuss.tryton.org/t/error-when-opening-invoices/6929/2 "2024-01-30T13:13:02Z")

</div>

Seams the same reported on [#12843](https://foss.heptapod.net/tryton/tryton/-/issues/12843).

Are you opening Invoices from the relate of a sale? if so, It’s the same.

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [January 30, 2024, 1:17pm UTC](https://discuss.tryton.org/t/error-when-opening-invoices/6929/3 "2024-01-30T13:17:24Z")

</div>

> [@acaubet](#):
>
> Are you opening Invoices from the relate of a sale?

True. I can post it when opening it from `accounting > invoices > customer invoices` directly.

Thanks !
