Skip to content

Commit

Permalink
Merge pull request #4121 from Tecnativa/16.0-ou-fix-website_sale_requ…
Browse files Browse the repository at this point in the history
…ire_login

[16.0][OU-FIX] base: fix script
  • Loading branch information
pedrobaeza authored Sep 4, 2023
2 parents 8208b56 + a6ac1d6 commit e327040
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@


def login_or_registration_required_at_checkout(cr):
"""website_sale_require_login merged into website_sale. Check if the
website_sale_require_login module was installed in v15 to set the
website.account_on_checkout field as mandatory so that the functionality
remains the same, login/registration required for checkout."""
"""The website_sale_require_login module is merged into website_sale. Check if the
it was installed in v15 to set the website.account_on_checkout field as mandatory
so that the functionality remains the same, login/registration required for
checkout."""
# Check if the module is installed and its status is "installed".
module_name = "website_sale_require_login"
if openupgrade.is_module_installed(cr, module_name):
if openupgrade.is_module_installed(cr, "website_sale_require_login"):
# Add the field 'account_on_checkout' to the 'website' table if it doesn't exist yet.
openupgrade.logged_query(
cr,
"""
ALTER TABLE website
ADD COLUMN IF NOT EXISTS account_on_checkout
ADD COLUMN IF NOT EXISTS account_on_checkout VARCHAR
""",
)
# Set the value 'mandatory' in the field for all records in the table 'website'.
Expand Down

0 comments on commit e327040

Please sign in to comment.