Account invoice payment term delta migration fails
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 | |