Unit removed in v6.8

In version v6.8 the unit: Work Day has been removed (Remove non-standard work day unit (386a850b55c7) · Commits · Tryton / Tryton · GitLab). When updating to this version there is a problem if this unit has been used.

What the best way to solve this?

I tried:

DELETE FROM "ir_model_data" WHERE model = 'product.uom' AND "fsid" = 'uom_work_day' AND module = 'product';

this seems to work, is this the right way to do it?

What is the problem?

The update process try to remove the unit ‘Work Day’ but it’s used by some product and sale (for example).

This should not be a problem.

Here is the message (during the update: --all ) :

97658 139685197199168 [2023-05-27 16:07:12,877] INFO trytond.convert Deleting None@product.uom from product.uom_work_day
--- Logging error ---
Traceback (most recent call last):
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/convert.py", line 811, in post_import
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/model/modelsql.py", line 234, in wrapper
    return func(cls, *args, **kwargs)
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/model/modelsql.py", line 1371, in delete
    ids = list(map(int, records))
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/model/model.py", line 322, in __int__
    return int(self.id)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xt0ph/.pyenv/versions/3.9.2/lib/python3.9/logging/__init__.py", line 1079, in emit
    msg = self.format(record)
  File "/home/xt0ph/.pyenv/versions/3.9.2/lib/python3.9/logging/__init__.py", line 923, in format
    return fmt.format(record)
  File "/home/xt0ph/.pyenv/versions/3.9.2/lib/python3.9/logging/__init__.py", line 659, in format
    record.message = record.getMessage()
  File "/home/xt0ph/.pyenv/versions/3.9.2/lib/python3.9/logging/__init__.py", line 363, in getMessage
    msg = msg % self.args
TypeError: %d format: a number is required, not NoneType
Call stack:
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/./trytond/bin/trytond-admin", line 31, in <module>
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/admin.py", line 57, in run
    pool.init(update=options.update, lang=list(lang),
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/pool.py", line 167, in init
    restart = not load_modules(
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/modules/__init__.py", line 453, in load_modules
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/modules/__init__.py", line 421, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/modules/__init__.py", line 314, in load_module_graph
    convert.post_import(pool, module, to_delete)
  File "/home/xt0ph/Documents/technique/tryton/clients/adiczion/ate/trytond/trytond/convert.py", line 819, in post_import
Message: 'Could not delete id %d from model %s.\nThere may be a relation that points to this resource that must be manually fixed before restarting the update.'
Arguments: (None, 'product.uom')

Indeed we should just have the INFO and avoid logging the error.