Since Migration from 6.8 to 7.0, decimal problems

Since I’ve migrate from 6.8 to 7.0, I encounter mutliple decimal problems on the tryton client:

When creating a sale:

    value = Decimal(locale.delocalize(text, self.monetary))

InvalidOperation: [<class 'decimal.ConversionSyntax'>]

After, when saving:

Le nombre de décimales de la valeur 35.00000000000000000 pour le champ  prix unitaire sur [...] excède la limite de "4"

I’m not able to pay a bill anymore, with similar messages.

BUT: this is not happening with the HTML SAO, only with the python client.

I’ve followed the migration procedure, going from 6.6 to 6.8 and then to 7.0
My config remain the same, any clue to debug this?

Sounds related to round can raise InvalidOperation (#12866) · Issues · Tryton / Tryton · GitLab or to Sepa payments rejected because of exagerated decimal values (#12587) · Issues · Tryton / Tryton · GitLab

But both are fixed on the latest tryton/trytond versions.
Which server and client versions are you using? Are you sure to use the latest one?

Latest I think, this is my pip freeze output:

backports.entry-points-selectable==1.3.0
beautifulsoup4==4.12.3
defusedxml==0.7.1
febelfin-coda==0.3.0
Genshi==0.7.7
lxml==5.1.0
MarkupSafe==2.1.5
ofxparse==0.21
passlib==1.7.4
polib==1.2.0
psycopg2==2.9.9
python-dateutil==2.8.2
python-magic==0.4.27
python-sql==1.4.3
python-stdnum==1.19
relatorio==0.10.1
simpleeval==0.9.13
six==1.16.0
soupsieve==2.5
trytond==7.0.6
trytond-account==7.0.3
trytond-account-asset==7.0.0
trytond-account-be==7.0.0
trytond-account-eu==7.0.0
trytond-account-invoice==7.0.1
trytond-account-invoice-history==7.0.0
trytond-account-invoice-line-standalone==7.0.0
trytond-account-invoice-stock==7.0.1
trytond-account-payment==7.0.1
trytond-account-payment-clearing==7.0.1
trytond-account-payment-sepa==7.0.0
trytond-account-product==7.0.0
trytond-account-statement==7.0.0
trytond-account-statement-coda==7.0.0
trytond-account-statement-ofx==7.0.0
trytond-account-statement-rule==7.0.0
trytond-analytic-account==7.0.0
trytond-analytic-invoice==7.0.0
trytond-analytic-purchase==7.0.0
trytond-analytic-sale==7.0.0
trytond-bank==7.0.0
trytond-company==7.0.0
trytond-company-work-time==7.0.0
trytond-country==7.0.0
trytond-currency==7.0.0
trytond-dashboard==7.0.0
trytond-party==7.0.0
trytond-product==7.0.1
trytond-purchase==7.0.1
trytond-sale==7.0.1
trytond-sale-discount==7.0.0
trytond-stock==7.0.3
trytond-stock-consignment==7.0.0
trytond-timesheet==7.0.0
werkzeug==3.0.1

Ok. The client was 7.0.0. If I use the 7.0.5 client, the decimal problem is gone.
But when trying to validate the bill another problem occur:

    value = value if operator == '=' and single_value else value[0]

TypeError: 'int' object is not subscriptable

Could you please show the full traceback?

I suspect it’s linked to a domain inversion issue but I’m not sure.

Indeed:

  File "/home/laron/.local/lib/python3.8/site-packages/tryton/gui/window/view_form/view/form.py", line 616, in button_clicked
    self.screen.button(widget.attrs)
  File "/home/laron/.local/lib/python3.8/site-packages/tryton/gui/window/view_form/screen/screen.py", line 1199, in button
    if not record.validate(fields, pre_validate=domain):
  File "/home/laron/.local/lib/python3.8/site-packages/tryton/gui/window/view_form/model/record.py", line 420, in validate
    if not field.validate(self, softvalidation, pre_validate):
  File "/home/laron/.local/lib/python3.8/site-packages/tryton/gui/window/view_form/model/field.py", line 884, in validate
    test = super(O2MField, self).validate(record, softvalidation,
  File "/home/laron/.local/lib/python3.8/site-packages/tryton/gui/window/view_form/model/field.py", line 115, in validate
    unique, leftpart, value = unique_value(
  File "/home/laron/.local/lib/python3.8/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
1 Like

It looks like Crash when opening invoice relate (#12843) · Issues · Tryton / Tryton · GitLab

Indeed, looks the same, this crash is not happening with client 7.0.2
Thanks all

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.