oca-purchase/odoo-bringout-oca-purchase-workflow-purchase_triple_discount/purchase_triple_discount/hooks.py
Ernad Husremovic 7378b233e9 Add oca-purchase submodule with 96 purchase modules moved from oca-workflow-process
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 18:00:40 +02:00

25 lines
670 B
Python

# Copyright 2024-Today - Sylvain Le GAL (GRAP)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
_logger = logging.getLogger(__name__)
def post_init_hook(cr, registry):
_logger.info("Initializing column discount1 on table purchase_order_line")
cr.execute(
"""
UPDATE purchase_order_line
SET discount1 = discount
WHERE discount != 0
"""
)
_logger.info("Initializing column discount1 on table product_supplierinfo")
cr.execute(
"""
UPDATE product_supplierinfo
SET discount1 = discount
WHERE discount != 0
"""
)