mirror of
https://github.com/bringout/oca-financial.git
synced 2026-04-26 05:01:59 +02:00
29 lines
656 B
Python
29 lines
656 B
Python
import logging
|
|
|
|
from odoo import tools
|
|
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
|
|
def pre_init_hook(cr):
|
|
"""
|
|
Initializing column custom_rate on table account_move
|
|
for the improvement in performance to avoid long
|
|
duration in databases with thousand of moves
|
|
"""
|
|
_logger.info("Initializing column custom_rate on table account_move")
|
|
tools.create_column(
|
|
cr=cr,
|
|
tablename="account_move",
|
|
columnname="custom_rate",
|
|
columntype="numeric",
|
|
comment="Custom Rate",
|
|
)
|
|
cr.execute(
|
|
"""
|
|
UPDATE
|
|
account_move
|
|
SET
|
|
custom_rate = 1.0
|
|
"""
|
|
)
|