mirror of
https://github.com/OCA/stock-logistics-reporting.git
synced 2025-02-16 17:13:21 +02:00
stock_average_daily_sale: Pre-migration script
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
"name": "Stock Average Daily Sale",
|
"name": "Stock Average Daily Sale",
|
||||||
"summary": """
|
"summary": """
|
||||||
Allows to gather delivered products average on daily basis""",
|
Allows to gather delivered products average on daily basis""",
|
||||||
"version": "16.0.1.0.0",
|
"version": "16.0.1.1.0",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "ACSONE SA/NV,BCIM,Odoo Community Association (OCA)",
|
"author": "ACSONE SA/NV,BCIM,Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/stock-logistics-reporting",
|
"website": "https://github.com/OCA/stock-logistics-reporting",
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Copyright 2024 Camptocamp SA (http://www.camptocamp.com)
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
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")
|
||||||
Reference in New Issue
Block a user