-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP]sale_delivery_state: migration script
- Loading branch information
1 parent
e03b9c8
commit e182124
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
sale_delivery_state/migrations/15.0.2.0.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2024 Manuel Regidor <[email protected]> | ||
# 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 column_exists(cr, "sale_order_line", "skip_sale_delivery_state"): | ||
_logger.info("Create sale_order_line column skip_sale_delivery_state") | ||
create_column(cr, "sale_order_line", "skip_sale_delivery_state", "boolean") | ||
cr.execute("UPDATE sale_order_line SET skip_sale_delivery_state = False") |