← Back to team overview

openupgrade-drivers team mailing list archive

Re: Problems while upgrading to 8.0.

 

On 26-12-14 22:52, Manuel Vázquez Acosta wrote:
> Hi all,
>
> First, let me apologize myself for the long email.  Is both a log of my
> progress and proposals of change.
>
>

Well, thank you for your detailed analysis and sharing your insights!

> TypeError: can't compare offset-naive and offset-aware datetimes
>
>
> Probably this is an error in one of our addons that didn't set the until
> right.  I will solve it by introducing a pre migration that rewrites all
> UNTIL rrules ensuring they are tz-aware in UTC (that would be the right
> thing to do most of the time, isn't it?).

I think so. Can you file a pull request? Maybe other people have the
same problem.

> This is because calendar's search method returns the "virtual ids"
> instead of the real ids.   Has anyone had the same issues?
>
> What I did was to simply replace the search call in
> set_message_last_post with::
>
> cr.execute('SELECT id FROM {table}'.format(table=model_pool._table))
> obj_ids = [row[0] for row in cr.fetchall()]
>

Thanks for pointing this out. Seems valid in every case, so we should
just adopt this I guess.

> IntegrityError: insert or update on table "hr_holidays" violates foreign
> key constraint "hr_holidays_meeting_id_fkey"
> DETAIL:  Key (meeting_id)=(3990) is not present in table "crm_meeting".
>
> But then the hr_holidays modules is not reported as Done yet (in the
> OpenUpgrade page is still blank).  Nevertheless the
> openupgrade_analysis_work.txt file seems to be Done (both in 8.0-crm and
> 8.0).  Any ideas?

Yes, we forgot to lift the foreign key constraint on the old model
table. Before this line, try

cr.execute("ALTER TABLE crm_lead DROP CONSTRAINT
hr_holidays_meeting_id_fkey"). The ORM will create a new constraint on
the new table.

Cheers,
Stefan.

 



Follow ups

References