Skip to content

Commit

Permalink
stock_average_daily_sale: Pre-migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
twalter-c2c committed Sep 13, 2024
1 parent 448443f commit 6abf060
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stock_average_daily_sale/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Stock Average Daily Sale",
"summary": """
Allows to gather delivered products average on daily basis""",
"version": "16.0.1.0.0",
"version": "16.0.1.1.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,BCIM,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-reporting",
Expand Down
20 changes: 20 additions & 0 deletions stock_average_daily_sale/migrations/16.0.1.1.0/pre-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2024 Camptocamp SA (http://www.camptocamp.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

import logging

from odoo.tools.sql import column_exists, create_column

_logger = logging.getLogger(__name__)


def migrate(cr, version):
if not version:
return

if not column_exists(cr, "stock_average_daily_sale_config", "exclude_weekends"):
_logger.info("Create stock_average_daily_sale_config column exclude_weekends")
create_column(
cr, "stock_average_daily_sale_config", "exclude_weekends", "boolean"
)
cr.execute("UPDATE stock_average_daily_sale_config SET exclude_weekends = True")

0 comments on commit 6abf060

Please sign in to comment.