Issue 7962

Title
Account invoice payment term delta migration fails
Priority
bug
Status
resolved
Nosy list
ced, pokoli, roundup-bot
Assigned to
ced
Keywords

Created on 2019-01-03.11:55:03 by pokoli, last changed 27 months ago by roundup-bot.

Messages

New changeset 8e06f7f46620 by Cédric Krier in branch 'default':
Fix migration to use ir.calendar
https://hg.tryton.org/tryton-env/rev/8e06f7f46620
New changeset f5a9cbf6d256 by Cédric Krier in branch 'default':
Fix migration to use ir.calendar
https://hg.tryton.org/modules/sale_subscription/rev/f5a9cbf6d256
New changeset 3040ffe93c9d by Cédric Krier in branch 'default':
Fix migration to use ir.calendar
https://hg.tryton.org/modules/account_invoice/rev/3040ffe93c9d
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2019-01-03.11:55:02
I've get the following exception when updating a database with all latest trunk changes:

6283 140491008054784 [2019-01-03 10:52:07,105] WARNING trytond.backend.postgresql.table Unable to migrate column month on table account_invoice_payment_term_line_delta from varchar to int4.
Traceback (most recent call last):
  File "/home/pokoli/.virtualenvs/nclone/bin/trytond-admin", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/pokoli/projectes/nclone/trytond/bin/trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/pokoli/projectes/nclone/trytond/trytond/admin.py", line 54, in run
    activatedeps=options.activatedeps)
  File "/home/pokoli/projectes/nclone/trytond/trytond/pool.py", line 160, in init
    lang=lang, activatedeps=activatedeps)
  File "/home/pokoli/projectes/nclone/trytond/trytond/modules/__init__.py", line 420, in load_modules
    _load_modules(update)
  File "/home/pokoli/projectes/nclone/trytond/trytond/modules/__init__.py", line 390, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/home/pokoli/projectes/nclone/trytond/trytond/modules/__init__.py", line 218, in load_module_graph
    cls.__register__(module)
  File "/home/pokoli/projectes/nclone/trytond/trytond/modules/account_invoice/payment_term.py", line 290, in __register__
    super(PaymentTermLineRelativeDelta, cls).__register__(module_name)
  File "/home/pokoli/projectes/nclone/trytond/trytond/model/modelsql.py", line 276, in __register__
    table.add_fk(field_name, ref, field.ondelete)
  File "/home/pokoli/projectes/nclone/trytond/trytond/backend/postgresql/table.py", line 325, in add_fk
    'ON DELETE ' + on_delete)
  File "/home/pokoli/projectes/nclone/trytond/trytond/backend/postgresql/database.py", line 65, in execute
    cursor.execute(self, sql, args)
psycopg2.ProgrammingError: foreign key constraint "account_invoice_payment_term_line_delta_month_fkey" cannot be implemented
DETAIL:  Key columns "month" and "id" are of incompatible types: character varying and integer.

Here is the data on my table:

select * from account_invoice_payment_term_line_delta;
 id |        create_date        | create_uid | day | days | line | month | months | sequence | weekday | weeks | write_date | write_uid 
----+---------------------------+------------+-----+------+------+-------+--------+----------+---------+-------+------------+-----------
  5 | 2018-09-28 08:13:00.35387 |          1 |     |    0 |    5 |       |      0 |          |         |     0 |            |          
  6 | 2018-09-28 08:13:00.35387 |          1 |     |    0 |    6 |       |      1 |          |         |     0 |            |
History
Date User Action Args
2019-01-03 12:04:26roundup-botsetmessages: + msg45812
2019-01-03 12:00:49roundup-botsetmessages: + msg45810
2019-01-03 12:00:45roundup-botsetstatus: in-progress -> resolved
nosy: + roundup-bot
messages: + msg45808
2019-01-03 11:57:22cedsetstatus: unread -> in-progress
assignedto: ced
nosy: + ced
2019-01-03 11:55:03pokolicreate

Showing 10 items. Show all history (warning: this could be VERY long)