Skip to content

[MIG] event: Migration scripts - #712

Merged
pedrobaeza merged 4 commits into
OCA:9.0from
Tecnativa:9.0-mig-event
Jan 16, 2017
Merged

[MIG] event: Migration scripts#712
pedrobaeza merged 4 commits into
OCA:9.0from
Tecnativa:9.0-mig-event

Conversation

@cubells

@cubells cubells commented Dec 26, 2016

Copy link
Copy Markdown
Member
  • Analysis work
  • Pre-migration script
  • Post-migration script

@pedrobaeza

Copy link
Copy Markdown
Member

Why have you used 8.0 commits? In this case, you don't have to follow the migration guide: don't import commits corresponding to previous version.

* Analysis work
* Pre-migration script
* Post-migration script
@hbrunn hbrunn added this to the 9.0 milestone Dec 27, 2016


event / event.event / event_logo (html) : NEW
# Noting to do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Noting/Nothing

# Nothing to do as country_id is now a related field from address_id

event / event.event / email_confirmation_id (many2one): DEL relation: email.template
event / event.event / email_registration_id (many2one): DEL relation: email.template

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worries me, as we have customers using specific templates for each event. How Odoo v9 handles this? Anyway, at least we need to keep the columns if an specific module restoring this function comes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Columns are renamed.


def update_seats_availability(cr):
cr.execute("""
UPDATE event_event

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to indent so much these lines. One indent level more than previous line is enough.

cr.execute("""
UPDATE event_event
SET seats_availability = 'limited'
WHERE seats_max IS NOT NULL

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seats_max is an integer, so the value is NULL or 0 when you don't set it?

event / event.event / type (many2one) : was renamed to event_type_id [nothing to to]
# Nothing to do

event / event.mail / event_id (many2one) : NEW relation: event.event, required: required

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the replacement of the two dissapeared fields with templates? Without looking the code or runbot, it seems this is a way to program reminders and steps to send emails in certain stages.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it isn't. The field contains the template of the mail that will be automatically sent. It isn't the same that email_confirmation_id and email_registration_id fields.

event / event.registration / user_id (many2one) : DEL relation: res.users
# Nothing to do: new relation

event / event.type / default_email_event (many2one): DEL relation: email.template

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we put now default event.mail?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this feature don't exist in version 9.0.

@pedrobaeza

Copy link
Copy Markdown
Member

This is still pending the creation of mail records.

@pedrobaeza

Copy link
Copy Markdown
Member

cc @Tecnativa

@cubells

cubells commented Jan 6, 2017

Copy link
Copy Markdown
Member Author

cc @pedrobaeza

@pedrobaeza
pedrobaeza merged commit 2b0ddb1 into OCA:9.0 Jan 16, 2017
@pedrobaeza
pedrobaeza deleted the 9.0-mig-event branch January 16, 2017 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants