Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][MIG] website_sale #2880

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion docsource/modules130-140.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
|l10n_ar | |
+--------------------------------------------+-------------------------------------------------+
| |new| l10n_ar_website_sale | |
| |new| l10n_ar_website_sale | Done |
+--------------------------------------------+-------------------------------------------------+
|l10n_at | |
+--------------------------------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<record id="product_pricelist_comp_rule" model="ir.rule">
<field name="global"/>
<!-- <field name="global"/>-->
</record>
<record id="product_pricelist_item_comp_rule" model="ir.rule">
<field name="global"/>
<!-- <field name="global"/>-->
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---Models in module 'website_sale'---
obsolete model product.style (renamed to product.ribbon)
new model product.ribbon (renamed from product.style)
new model website.sale.extra.field
---Fields in module 'website_sale'---
website_sale / product.public.category / _order : _order is now 'sequence, name, id' ('sequence, name')
website_sale / product.public.category / seo_name (char) : NEW
website_sale / product.ribbon / bg_color (char) : NEW
website_sale / product.ribbon / html (char) : NEW required
website_sale / product.ribbon / text_color (char) : NEW
website_sale / product.style / html_class (char) : now required, req_default: function
website_sale / product.style / name (char) : DEL required
website_sale / product.template / seo_name (char) : NEW
website_sale / product.template / website_ribbon_id (many2one) : NEW relation: product.ribbon
website_sale / product.template / website_style_ids (many2many) : DEL relation: product.style
# Done in pre-migration
website_sale / website / shop_extra_field_ids (one2many): NEW relation: website.sale.extra.field
website_sale / website.sale.extra.field / field_id (many2one) : NEW relation: ir.model.fields
website_sale / website.sale.extra.field / sequence (integer) : NEW hasdefault
website_sale / website.sale.extra.field / website_id (many2one) : NEW relation: website
---XML records in module 'website_sale'---
DEL ir.actions.act_window: website_sale.action_abandoned_orders_ecommerce
NEW ir.actions.server: website_sale.dynamic_snippet_products_action
NEW ir.model.access: website_sale.access_ecom_extra_fields_public
NEW ir.model.access: website_sale.access_ecom_extra_fields_publisher
NEW ir.model.access: website_sale.access_product_ribbon_public
NEW ir.model.access: website_sale.access_product_ribbon_sale_manager
NEW ir.model.access: website_sale.access_website_sale_payment_acquirer_onboarding_wizard
DEL ir.model.access: website_sale.access_product_style
DEL ir.model.access: website_sale.access_product_supplierinfo
DEL ir.model.access: website_sale.access_product_supplierinfo_user
DEL ir.rule: website_sale.product_supplierinfo_public (noupdate)
NEW ir.ui.view: website_sale.assets_snippet_s_dynamic_snippet_products_js_000
NEW ir.ui.view: website_sale.assets_snippet_s_products_searchbar_js_000
NEW ir.ui.view: website_sale.ecom_show_extra_fields
NEW ir.ui.view: website_sale.header_cart_link
NEW ir.ui.view: website_sale.header_hide_empty_cart_link
NEW ir.ui.view: website_sale.product_custom_text
NEW ir.ui.view: website_sale.products_images_full
NEW ir.ui.view: website_sale.s_dynamic_snippet_products
NEW ir.ui.view: website_sale.s_dynamic_snippet_products_options
NEW ir.ui.view: website_sale.searchbar_input_snippet_options
NEW ir.ui.view: website_sale.template_header_boxed
NEW ir.ui.view: website_sale.template_header_centered_logo
NEW ir.ui.view: website_sale.template_header_contact
NEW ir.ui.view: website_sale.template_header_default
NEW ir.ui.view: website_sale.template_header_hamburger
NEW ir.ui.view: website_sale.template_header_hamburger_full
NEW ir.ui.view: website_sale.template_header_image
NEW ir.ui.view: website_sale.template_header_magazine
NEW ir.ui.view: website_sale.template_header_minimalist
NEW ir.ui.view: website_sale.template_header_sidebar
NEW ir.ui.view: website_sale.template_header_slogan
NEW ir.ui.view: website_sale.template_header_vertical
NEW ir.ui.view: website_sale.view_website_sale_website_form
DEL ir.ui.view: website_sale.404
DEL ir.ui.view: website_sale.header
DEL ir.ui.view: website_sale.remove_external_snippets
DEL ir.ui.view: website_sale.website_sale_pricelist_form_view2
NEW product.ribbon: website_sale.new_ribbon (noupdate)
NEW product.ribbon: website_sale.sale_ribbon (noupdate)
NEW product.ribbon: website_sale.sold_out_ribbon (noupdate)
DEL product.style: website_sale.image_full (noupdate)
DEL product.style: website_sale.image_promo (noupdate)
NEW website.snippet.filter: website_sale.dynamic_filter_demo_products
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2021 Open Source Integrators <https://www.opensourceintegrators.com/>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
env.cr.execute(
""" UPDATE
product_template
SET
website_ribbon_id =
( SELECT
product_style_id
FROM
product_style_product_template_rel
WHERE
product_template_id=product_template.id
ORDER BY id DESC
LIMIT 1)
"""
)
23 changes: 23 additions & 0 deletions openupgrade_scripts/scripts/website_sale/14.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2021 Open Source Integrators <https://www.opensourceintegrators.com/>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade

_model_renames = [
("product.style", "product.ribbon"),
]

_field_renames = [
("product.ribbon", "product_ribbon", "name", "html"),
]

_table_renames = [
("product_style", "product_ribbon"),
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_models(env.cr, _model_renames)
openupgrade.rename_tables(env.cr, _table_renames)
openupgrade.rename_fields(env, _field_renames)