From d21ab0c88aaba471c1489b6f403d505b474fa0be Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Wed, 21 Jan 2026 09:50:38 +0700 Subject: [PATCH] feat: Upgrade module to Odoo 19, updating API calls and view types from tree to list. --- __manifest__.py | 2 +- models/stock_readjust_valuation.py | 6 +++--- views/stock_readjust_valuation_views.xml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/__manifest__.py b/__manifest__.py index 903ed0a..a658261 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Stock Readjust Valuation', - 'version': '17.0.1.0.0', + 'version': '19.0.1.0.0', 'category': 'Inventory/Inventory', 'summary': 'Retrospective Stock Valuation Adjustment', 'description': """ diff --git a/models/stock_readjust_valuation.py b/models/stock_readjust_valuation.py index efe3bbf..9bae281 100644 --- a/models/stock_readjust_valuation.py +++ b/models/stock_readjust_valuation.py @@ -42,7 +42,7 @@ class StockReadjustValuation(models.Model): 'name': _('Journal Entries'), 'type': 'ir.actions.act_window', 'res_model': 'account.move', - 'view_mode': 'tree,form', + 'view_mode': 'list,form', 'domain': [('id', 'in', self.account_move_ids.ids)], 'context': {'create': False}, } @@ -437,11 +437,11 @@ class StockReadjustValuation(models.Model): date_map[t['date_svl']].append(svl.id) for d, ids in date_map.items(): - self._cr.execute("UPDATE stock_valuation_layer SET create_date = %s WHERE id IN %s", (d, tuple(ids))) + self.env.cr.execute("UPDATE stock_valuation_layer SET create_date = %s WHERE id IN %s", (d, tuple(ids))) # 4a. Force Dates Moves (Per Chunk) if chunk_moves: - self._cr.execute("UPDATE account_move SET date = %s WHERE id IN %s", (self.date_end.date(), tuple(chunk_moves.ids))) + self.env.cr.execute("UPDATE account_move SET date = %s WHERE id IN %s", (self.date_end.date(), tuple(chunk_moves.ids))) # Link Created Moves to this record (Important for Resume Logic) self.write({'account_move_ids': [(4, m.id) for m in chunk_moves]}) diff --git a/views/stock_readjust_valuation_views.xml b/views/stock_readjust_valuation_views.xml index 11307ad..8e73c56 100644 --- a/views/stock_readjust_valuation_views.xml +++ b/views/stock_readjust_valuation_views.xml @@ -37,7 +37,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -64,18 +64,18 @@ - + stock.readjust.valuation.tree stock.readjust.valuation - + - + @@ -83,7 +83,7 @@ Stock Readjustment stock.readjust.valuation - tree,form + list,form