mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
We want to make sure that we move the stock_move_id from the account.move to the account.move.line
17 lines
433 B
Python
17 lines
433 B
Python
# Copyright 2022 ForgeFlow S.L.
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
|
|
def post_init_hook(cr, registry):
|
|
|
|
"""INIT stock references in acount move line"""
|
|
# FOR stock moves
|
|
cr.execute(
|
|
"""
|
|
UPDATE account_move_line aml SET stock_move_id = am.stock_move_id
|
|
FROM account_move am
|
|
WHERE am.id = aml.move_id
|
|
AND am.stock_move_id IS NOT NULL;
|
|
"""
|
|
)
|