Skip to content

Commit

Permalink
[OU-ADD] website_sale: mig to 16.0 (#482)
Browse files Browse the repository at this point in the history
* [OU-ADD] website_sale: mig to 16.0

* Update openupgrade_scripts/scripts/website_sale/16.0.1.1/upgrade_analysis_work.txt

---------

Co-authored-by: Roy Le <[email protected]>
  • Loading branch information
ngochuy97hp and royle-vietnam authored Jul 21, 2023
1 parent 596d2a6 commit 869f8c2
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docsource/modules150-160.rst
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| website_profile |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| website_sale | | |
| website_sale | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |new| website_sale_autocomplete | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env.cr, "website_sale", "16.0.1.1/noupdate_changes.xml")
65 changes: 65 additions & 0 deletions openupgrade_scripts/scripts/website_sale/16.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
from openupgradelib import openupgrade


def _fill_add_to_cart_action_value(env):
openupgrade.logged_query(
env.cr,
"""
ALTER TABLE website
ADD COLUMN IF NOT EXISTS add_to_cart_action VARCHAR
""",
)
openupgrade.logged_query(
env.cr,
"""
UPDATE website
SET add_to_cart_action = CASE
WHEN cart_add_on_page = TRUE THEN 'stay'
ELSE 'go_to_cart'
END
""",
)


@openupgrade.migrate()
def migrate(env, version):
_fill_add_to_cart_action_value(env)
openupgrade.rename_fields(
env,
[
(
"res.company",
"res_company",
"website_sale_onboarding_payment_acquirer_state",
"website_sale_onboarding_payment_provider_state",
),
],
)
openupgrade.rename_xmlids(
env.cr,
[
(
"website_sale_stock_wishlist.ir_cron_send_availability_email",
"website_sale.ir_cron_send_availability_email",
),
],
)
openupgrade.set_xml_ids_noupdate_value(
env,
"website_sale",
[
"s_dynamic_snippet_products_000_scss",
"price_dynamic_filter_template_product_product",
"dynamic_filter_template_product_product_add_to_cart",
"dynamic_filter_template_product_product_banner",
"dynamic_filter_template_product_product_borderless_1",
"dynamic_filter_template_product_product_borderless_2",
"dynamic_filter_template_product_product_centered",
"dynamic_filter_template_product_product_horizontal_card",
"dynamic_filter_template_product_product_mini_image",
"dynamic_filter_template_product_product_mini_name",
"dynamic_filter_template_product_product_mini_price",
"dynamic_filter_template_product_product_view_detail",
],
False,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---Models in module 'website_sale'---
obsolete model website.sale.payment.acquirer.onboarding.wizard [transient]
---Fields in module 'website_sale'---
website_sale / product.ribbon / product_tag_ids (one2many) : NEW relation: product.tag
website_sale / product.tag / ribbon_id (many2one) : NEW relation: product.ribbon
website_sale / product.tag / website_id (many2one) : NEW relation: website
website_sale / product.template / compare_list_price (float) : NEW
# NOTHING TO DO: new features

website_sale / res.company / website_sale_onboarding_payment_acquirer_state (selection): DEL selection_keys: ['done', 'just_done', 'not_done']
website_sale / res.company / website_sale_onboarding_payment_provider_state (selection): NEW selection_keys: ['done', 'just_done', 'not_done'], hasdefault: default
# DONE: pre-migration: renamed field

website_sale / sale.order / shop_warning (char) : NEW
website_sale / sale.order.line / shop_warning (char) : NEW
# NOTHING TO DO: set shop_warning = warning_stock at website_sale_stock

website_sale / website / account_on_checkout (selection): NEW selection_keys: ['disabled', 'mandatory', 'optional'], hasdefault: default
website_sale / website / add_to_cart_action (selection): NEW selection_keys: ['go_to_cart', 'stay'], hasdefault: default
website_sale / website / cart_add_on_page (boolean) : DEL
# DONE: pre-migration: filled value for add_to_cart_action

website_sale / website / contact_us_button_url (char) : NEW hasdefault: default
website_sale / website / enabled_portal_reorder_button (boolean): NEW
website_sale / website / prevent_zero_price_sale (boolean): NEW
website_sale / website / prevent_zero_price_sale_text (char): NEW hasdefault: default
website_sale / website / product_page_grid_columns (integer): NEW hasdefault: default
website_sale / website / product_page_image_layout (selection): NEW required, selection_keys: ['carousel', 'grid'], hasdefault: default
website_sale / website / product_page_image_spacing (selection): NEW required, selection_keys: ['big', 'medium', 'none', 'small'], hasdefault: default
website_sale / website / product_page_image_width (selection): NEW required, selection_keys: ['100_pc', '50_pc', '66_pc', 'none'], hasdefault: default
website_sale / website / send_abandoned_cart_email (boolean): NEW
website_sale / website / shop_default_sort (selection) : NEW required, selection_keys: function, hasdefault: default
website_sale / website.sale.extra.field / field_id (many2one) : now required
# NOTHING TO DO: new features

---XML records in module 'website_sale'---
NEW ir.actions.act_window: website_sale.action_product_pages_list
NEW ir.actions.act_window: website_sale.product_product_action_add
NEW ir.actions.act_window: website_sale.product_public_tags_action
DEL ir.actions.act_window: website_sale.action_open_website_sale_onboarding_payment_acquirer_wizard
NEW ir.actions.server: website_sale.dynamic_snippet_alternative_products
NEW ir.asset: website_sale.s_add_to_cart_000_js
# NOTHING TO DO

ir.asset: website_sale.s_dynamic_snippet_products_000_scss (noupdate switched)
# DONE: pre-migration: switched noupdate

NEW ir.cron: website_sale.ir_cron_send_availability_email [renamed from website_sale_stock_wishlist module]
# DONE: pre-migration: renamed xmlids

NEW ir.model.access: website_sale.access_ecom_extra_fields_restricted_editor
NEW ir.model.access: website_sale.access_product_image_restricted_editor
NEW ir.model.access: website_sale.access_product_tag_public
DEL ir.model.access: website_sale.access_ecom_extra_fields_publisher
DEL ir.model.access: website_sale.access_product_image_publisher
DEL ir.model.access: website_sale.access_website_sale_payment_acquirer_onboarding_wizard
NEW ir.ui.menu: website_sale.menu_ecommerce
NEW ir.ui.menu: website_sale.menu_ecommerce_payment_providers
NEW ir.ui.menu: website_sale.menu_product_pages
NEW ir.ui.menu: website_sale.product_catalog_product_tags
DEL ir.ui.menu: website_sale.menu_ecommerce_payment_acquirers
DEL ir.ui.menu: website_sale.menu_product_settings
DEL ir.ui.menu: website_sale.menu_reporting [renamed to website module]
DEL ir.ui.menu: website_sale.product_catalog_variants
DEL ir.ui.menu: website_sale.website_base_unit_menu
NEW ir.ui.view: website_sale.alternative_products
# NOTHING TO DO

ir.ui.view: website_sale.dynamic_filter_template_product_product_add_to_cart (noupdate switched)
ir.ui.view: website_sale.dynamic_filter_template_product_product_banner (noupdate switched)
ir.ui.view: website_sale.dynamic_filter_template_product_product_borderless_1 (noupdate switched)
ir.ui.view: website_sale.dynamic_filter_template_product_product_borderless_2 (noupdate switched)
# DONE: pre-migration: switched noupdate

NEW ir.ui.view: website_sale.dynamic_filter_template_product_product_card_group
ir.ui.view: website_sale.dynamic_filter_template_product_product_centered (noupdate switched)
ir.ui.view: website_sale.dynamic_filter_template_product_product_horizontal_card (noupdate switched)
# DONE: pre-migration: switched noupdate

NEW ir.ui.view: website_sale.dynamic_filter_template_product_product_horizontal_card_2
ir.ui.view: website_sale.dynamic_filter_template_product_product_mini_image (noupdate switched)
ir.ui.view: website_sale.dynamic_filter_template_product_product_mini_name (noupdate switched)
ir.ui.view: website_sale.dynamic_filter_template_product_product_mini_price (noupdate switched)
ir.ui.view: website_sale.dynamic_filter_template_product_product_view_detail (noupdate switched)
# DONE: pre-migration: switched noupdate

NEW ir.ui.view: website_sale.filmstrip_categories
NEW ir.ui.view: website_sale.o_wsale_offcanvas
# NOTHING TO DO

ir.ui.view: website_sale.price_dynamic_filter_template_product_product (noupdate switched)
# DONE: pre-migration: switched noupdate

NEW ir.ui.view: website_sale.product_category_extra_link
NEW ir.ui.view: website_sale.product_pages_kanban_view
NEW ir.ui.view: website_sale.product_pages_tree_view
NEW ir.ui.view: website_sale.product_picture_magnify_both
NEW ir.ui.view: website_sale.product_picture_magnify_click
NEW ir.ui.view: website_sale.product_picture_magnify_hover
NEW ir.ui.view: website_sale.product_product_view_form_add
NEW ir.ui.view: website_sale.product_tag_form_view_inherit_website_sale
NEW ir.ui.view: website_sale.product_tag_tree_view_inherit_website_sale
NEW ir.ui.view: website_sale.products_attributes_top
NEW ir.ui.view: website_sale.products_categories_list
NEW ir.ui.view: website_sale.products_categories_top
NEW ir.ui.view: website_sale.products_design_card
NEW ir.ui.view: website_sale.products_design_grid
NEW ir.ui.view: website_sale.products_design_thumbs
NEW ir.ui.view: website_sale.products_thumb_2_3
NEW ir.ui.view: website_sale.products_thumb_4_3
NEW ir.ui.view: website_sale.products_thumb_4_5
NEW ir.ui.view: website_sale.products_thumb_cover
NEW ir.ui.view: website_sale.res_config_settings_view_form_inherit_sale
NEW ir.ui.view: website_sale.s_add_to_cart
NEW ir.ui.view: website_sale.s_add_to_cart_options
NEW ir.ui.view: website_sale.sale_order_re_order_btn
NEW ir.ui.view: website_sale.shop_product_grid
NEW ir.ui.view: website_sale.shop_product_image
NEW ir.ui.view: website_sale.shop_product_images
NEW ir.ui.view: website_sale.snippets_options_web_editor
NEW ir.ui.view: website_sale.tax_indication
DEL ir.ui.view: website_sale.product_edit_options
DEL ir.ui.view: website_sale.product_picture_magnify
DEL ir.ui.view: website_sale.product_picture_magnify_auto
DEL ir.ui.view: website_sale.products_images_full
DEL ir.ui.view: website_sale.recommended_products
DEL ir.ui.view: website_sale.search_count_box
DEL ir.ui.view: website_sale.user_navbar_inherit_website_sale
DEL ir.ui.view: website_sale.website_sale_onboarding_payment_acquirer_step
NEW res.groups: website_sale.group_product_price_comparison (noupdate)
NEW website.snippet.filter: website_sale.dynamic_filter_cross_selling_alternative_products
# NOTHING TO DO

0 comments on commit 869f8c2

Please sign in to comment.