# Unit removed in v6.8

**URL:** https://discuss.tryton.org/t/unit-removed-in-v6-8/6199
**Category:** Developer
**Created:** [May 27, 2023, 4:04pm UTC](https://discuss.tryton.org/t/unit-removed-in-v6-8/6199 "2023-05-27T16:04:30Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![2cadz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/2cadz/32/130_2.png) [@2cadz](https://discuss.tryton.org/u/2cadz)
#### Post date: [May 27, 2023, 4:04pm UTC](https://discuss.tryton.org/t/unit-removed-in-v6-8/6199/1 "2023-05-27T16:04:30Z")

</div>

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

What the best way to solve this?

---

<div class="post-metadata">

### Author: ![2cadz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/2cadz/32/130_2.png) [@2cadz](https://discuss.tryton.org/u/2cadz)
#### Post date: [May 27, 2023, 4:33pm UTC](https://discuss.tryton.org/t/unit-removed-in-v6-8/6199/2 "2023-05-27T16:33:58Z")

</div>

I tried:

```auto
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?

---

<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: [May 27, 2023, 4:56pm UTC](https://discuss.tryton.org/t/unit-removed-in-v6-8/6199/3 "2023-05-27T16:56:09Z")

</div>

> [@2cadz](#):
>
> When updating to this version there is a problem if this unit has been used.

What is the problem?

---

<div class="post-metadata">

### Author: ![2cadz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/2cadz/32/130_2.png) [@2cadz](https://discuss.tryton.org/u/2cadz)
#### Post date: [May 27, 2023, 5:46pm UTC](https://discuss.tryton.org/t/unit-removed-in-v6-8/6199/4 "2023-05-27T17:46:55Z")

</div>

> [@ced](#):
>
> 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).

---

<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: [May 27, 2023, 9:42pm UTC](https://discuss.tryton.org/t/unit-removed-in-v6-8/6199/5 "2023-05-27T21:42:23Z")

</div>

This should not be a problem.

---

<div class="post-metadata">

### Author: ![2cadz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/2cadz/32/130_2.png) [@2cadz](https://discuss.tryton.org/u/2cadz)
#### Post date: [May 28, 2023, 6:48am UTC](https://discuss.tryton.org/t/unit-removed-in-v6-8/6199/6 "2023-05-28T06:48:56Z")

</div>

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

```auto
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
    Model.delete([Model(db_id)])
  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>
    admin.run(options)
  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
    _load_modules(update)
  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
    logger.error(
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')

```

---

<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: [May 29, 2023, 10:24am UTC](https://discuss.tryton.org/t/unit-removed-in-v6-8/6199/7 "2023-05-29T10:24:20Z")

</div>

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