tryton (gtk) client (6.8.8) exception regarding domain validation (unique_value) when opening newly generated invoice
After updating the client to 6.8.8 (from 6.8.2) We kept getting errors/tracebacks when trying to open/edit newly generated invoices. Reverting to 6.8.2 it worked again. After checking the commit history/changes I found this commit
The traceback is caused by line 387 (in my traceback below 388 as I added a print statement for debugging)
I am unsure as to what exactly is causing this as I am not that familiar with this part of the code so here is the traceback with the extra debug info (as you can see that one time single_value is (wrongly) set to False when value is type integer though):
##### unique_value name='company' single_value=True value=1 model=[] domain=[['company', '=', 1]]
##### unique_value name='company' single_value=True value=1 model=[] domain=[['company', '=', 1]]
##### unique_value name='to_location' single_value=True value=2 model=[] domain=[['to_location', '=', 2]]
##### unique_value name='to_location' single_value=True value=2 model=[] domain=[['to_location', '=', 2]]
##### unique_value name='lines.origin.sale.id' single_value=False value=12419 model=['sale.line'] domain=[['lines.origin.sale.id', '=', 12419, 'sale.line']]
ERROR:tryton.common.common: File "/usr/lib/python3.11/site-packages/tryton/gui/window/view_form/view/form.py", line 350, in switch
self.view.display()
File "/usr/lib/python3.11/site-packages/tryton/gui/window/view_form/view/form.py", line 540, in display
record[field].get(record)
~~~~~~^^^^^^^
File "/usr/lib/python3.11/site-packages/tryton/gui/window/view_form/model/record.py", line 47, in __getitem__
self.load(name)
File "/usr/lib/python3.11/site-packages/tryton/gui/window/view_form/model/record.py", line 154, in load
record.set(value, modified=False)
File "/usr/lib/python3.11/site-packages/tryton/gui/window/view_form/model/record.py", line 497, in set
self.validate(fieldnames, softvalidation=True)
File "/usr/lib/python3.11/site-packages/tryton/gui/window/view_form/model/record.py", line 416, in validate
if not field.validate(self, softvalidation, pre_validate):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tryton/gui/window/view_form/model/field.py", line 884, in validate
test = super(O2MField, self).validate(record, softvalidation,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tryton/gui/window/view_form/model/field.py", line 115, in validate
unique, leftpart, value = unique_value(
^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tryton/common/domain_inversion.py", line 388, in unique_value
value = value if operator == '=' and single_value else value[0]
~~~~~^^^
TypeError: 'int' object is not subscriptable
##### unique_value name='company' single_value=True value=1 model=[] domain=[['company', '=', 1]]
##### unique_value name='company' single_value=True value=1 model=[] domain=[['company', '=', 1]]
##### unique_value name='currency' single_value=True value=44 model=[] domain=[['currency', '=', 44]]
##### unique_value name='currency' single_value=True value=44 model=[] domain=[['currency', '=', 44]]
##### unique_value name='account' single_value=True value=5 model=[] domain=[['account', '!=', 5]]
##### unique_value name='account' single_value=True value=5 model=[] domain=[['account', '!=', 5]]