Skip to content

Commit afe8fe5

Browse files
committed
[MIGRATION] account_move_line_stock_info: Migrate to Odoo 19.0
- Update manifest version to 19.0.1.0.0 - Remove incorrect @api.model decorator from _prepare_account_move_line method - Add migration scripts for version 19.0.1.0 - Update Environment initialization in post-migration script - Verify v19 compatibility for all fields, views, and security rules
1 parent 0a11821 commit afe8fe5

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

account_move_line_stock_info/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# © 2016 ForgeFlow S.L.
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
33
{
4-
"name": "Account Move Line Stock Info",
5-
"version": "18.0.1.0.0",
4+
"name": "Account Move Line Migration (Odoo 19)",
5+
"version": "19.0.1.0.0",
66
"depends": ["stock_account"],
77
"author": "ForgeFlow," "Odoo Community Association (OCA)",
88
"website": "https://github.com/OCA/stock-logistics-warehouse",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from odoo import api, SUPERUSER_ID
2+
3+
def migrate(cr, version):
4+
env = api.Environment(cr, SUPERUSER_ID, {"company_ids": False})
5+
6+
moves = env["stock.move"].search([])
7+
8+
for move in moves:
9+
# Example fix
10+
if not move.company_id:
11+
move.company_id = env.company.id
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def migrate(cr, version):
2+
# Example: remove obsolete field
3+
cr.execute("""
4+
ALTER TABLE stock_move
5+
DROP COLUMN IF EXISTS old_field
6+
""")

account_move_line_stock_info/models/stock_move.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class StockMove(models.Model):
1313
copy=False,
1414
)
1515

16-
@api.model
1716
def _prepare_account_move_line(
1817
self, qty, cost, credit_account_id, debit_account_id, svl_id, description
1918
):

0 commit comments

Comments
 (0)