Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---Fields in module 'rating'---
rating / rating.rating / consumed (boolean) : NEW

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 analysis file is not correct... this field exists also in v10, but other new fields like rating_image or rating_text are not reported. @StefanRijnhart do you have idea why?

@StefanRijnhart StefanRijnhart May 23, 2018

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.

Ah @pedrobaeza you are looking at the analysis of 10.0 so this field should be here. As for rating_image and rating_text in 11.0, these are computed fields and have been traditionally left out of the analysis as they presumably do not need any work.

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.

Agh, I have mixed v10 and v11 as we have both. Sorry for the noise.

@pedrobaeza pedrobaeza May 23, 2018

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.

@cubells you have to set this to True if rating != -1, which is the previous default value when unset.

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.

EDIT: Sorry, the correct comparison value is != -1

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.

@pedrobaeza
done!

# Done: update value depending on rating

---XML records in module 'rating'---
NEW ir.ui.view: rating.rating_external_page_submit
# Nothing to do
24 changes: 24 additions & 0 deletions addons/rating/migrations/10.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2018 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


def update_consumed(env):
openupgrade.logged_query(
env.cr, """
UPDATE rating_rating rr
SET consumed = True
WHERE rating != -1
""")
openupgrade.logged_query(
env.cr, """
UPDATE rating_rating rr
SET rating = 0
WHERE rating = -1
""")


@openupgrade.migrate()
def migrate(env, version):
update_consumed(env)
2 changes: 1 addition & 1 deletion odoo/openupgrade/doc/source/modules90-100.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ missing in the new release are marked with |del|.
+-----------------------------------+-----------------------------------+
|purchase_requisition | |
+-----------------------------------+-----------------------------------+
|rating | |
|rating | Done |
+-----------------------------------+-----------------------------------+
|rating_project | |
+-----------------------------------+-----------------------------------+
Expand Down