# Migration error to 7.6 renaming sale\_line\_account\_tax

**URL:** https://discuss.tryton.org/t/migration-error-to-7-6-renaming-sale-line-account-tax/8903
**Category:** System Administrator
**Created:** [October 19, 2025, 4:40pm UTC](https://discuss.tryton.org/t/migration-error-to-7-6-renaming-sale-line-account-tax/8903 "2025-10-19T16:40:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jcm](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jcm/32/344_2.png) [@jcm](https://discuss.tryton.org/u/jcm)
#### Post date: [October 19, 2025, 4:40pm UTC](https://discuss.tryton.org/t/migration-error-to-7-6-renaming-sale-line-account-tax/8903/1 "2025-10-19T16:40:07Z")

</div>

Hi,

When migrating our db from 6.0 to 7.6, the tryton-admin –all --activate-dependencies command leads to an error where Sale register tries to rename sale\_line\_account\_tax into sale\_line-account\_tax.  
Any idea on how to correct or circumvent this?

```auto
File “/Users/jcm/Sites/_tryton/tryton7.6/venv/lib/python3.13/site-packages/trytond/modules/sale/sale.py”, line 2301, in register
super().register(module)
~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^
File “/Users/jcm/Sites/_tryton/tryton7.6/venv/lib/python3.13/site-packages/trytond/model/modelsql.py”, line 465, in register
history_table = cls.table_handler(module_name, history=True)
File “/Users/jcm/Sites/_tryton/tryton7.6/venv/lib/python3.13/site-packages/trytond/model/modelsql.py”, line 447, in table_handler
return backend.TableHandler(cls, history=history)
~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^
File “/Users/jcm/Sites/_tryton/tryton7.6/venv/lib/python3.13/site-packages/trytond/backend/table.py”, line 23, in new
instance._init(model, history=history)
~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/jcm/Sites/_tryton/tryton7.6/venv/lib/python3.13/site-packages/trytond/backend/postgresql/table.py”, line 118, in _init
migrate_to_identity(self.table_name, ‘__id’)
~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/jcm/Sites/_tryton/tryton7.6/venv/lib/python3.13/site-packages/trytond/backend/postgresql/table.py”, line 53, in migrate_to_identity
cursor.execute(
~~~~~~~~~~~~~~ ^
“SELECT nextval(format(%s, %s))”, (‘%I’, previous_seq_name,))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/jcm/Sites/_tryton/tryton7.6/venv/lib/python3.13/site-packages/trytond/backend/postgresql/database.py”, line 78, in execute
cursor.execute(self, sql, args)
~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^
psycopg2.errors.UndefinedTable: relation “sale_line-account_tax __history___ id_seq” does not exist

```

---

<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: [October 20, 2025, 8:25am UTC](https://discuss.tryton.org/t/migration-error-to-7-6-renaming-sale-line-account-tax/8903/2 "2025-10-20T08:25:16Z")

</div>

It seems that your table `sale_line-account_tax __history` is missing a sequence for the column `__ id`. Maybe it was renamed, in such case it must have the name expected by Tryton.

---

<div class="post-metadata">

### Author: ![jcm](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jcm/32/344_2.png) [@jcm](https://discuss.tryton.org/u/jcm)
#### Post date: [October 20, 2025, 8:54am UTC](https://discuss.tryton.org/t/migration-error-to-7-6-renaming-sale-line-account-tax/8903/3 "2025-10-20T08:54:35Z")

</div>

Thks Cédric,

It seems that the sequence exists and is already with a name in ‘\_’ instead of ‘-’. Should I rename it to ‘sale\_line-account\_tax\_\_history\_\_\_id\_seq‘?

```auto
psql# \ds sale_line*
                          List of relations
 Schema | Name | Type | Owner
--------+-----------------------------------------+----------+-------
 public | sale_line __history___ id_seq | sequence | jcm
 public | sale_line_account_tax __history___ id_seq | sequence | jcm
 public | sale_line_account_tax_id_seq | sequence | jcm
 public | sale_line_id_seq | sequence | jcm
 public | sale_line_moves_ignored_rel_id_seq | sequence | jcm
 public | sale_line_moves_recreated_rel_id_seq | sequence | jcm
(6 rows)

```

---

<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: [October 20, 2025, 9:14am UTC](https://discuss.tryton.org/t/migration-error-to-7-6-renaming-sale-line-account-tax/8903/4 "2025-10-20T09:14:59Z")

</div>

Probably if it is the one that is used for the default value of the `__id` column.

---

<div class="post-metadata">

### Author: ![hobbes](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/a698b9/32.png) [@hobbes](https://discuss.tryton.org/u/hobbes)
#### Post date: [November 9, 2025, 8:43pm UTC](https://discuss.tryton.org/t/migration-error-to-7-6-renaming-sale-line-account-tax/8903/5 "2025-11-09T20:43:47Z")

</div>

hello @jcm , I have the exact same problem, but for purchase\_line\_account\_tax\_\_history\_\_\_id\_seq. Did you find a way to solve it ?

@ced it might be a good idea to add that to the [Migration — Tryton Documentation](https://docs.tryton.org/latest/migration.html) page

---

<div class="post-metadata">

### Author: ![hobbes](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/a698b9/32.png) [@hobbes](https://discuss.tryton.org/u/hobbes)
#### Post date: [November 9, 2025, 9:09pm UTC](https://discuss.tryton.org/t/migration-error-to-7-6-renaming-sale-line-account-tax/8903/6 "2025-11-09T21:09:33Z")

</div>

for the record:

```sql
alter sequence purchase_line_account_tax __history___ id_seq rename to "purchase_line-account_tax __history___ id_seq";
alter sequence sale_line_account_tax __history___ id_seq rename to "sale_line-account_tax __history___ id_seq";

```

seemed to do the trick. I’ll see if everything works now.
