From 3b3c057f18c271ca43c646ebc1b99dce803ca574 Mon Sep 17 00:00:00 2001 From: andrea Date: Tue, 15 Oct 2024 14:47:49 +0200 Subject: [PATCH] Fix error when creating stock moves manually --- stock_lot_on_hand_first/models/__init__.py | 1 + stock_lot_on_hand_first/models/stock_move_line.py | 12 ++++++++++++ stock_lot_on_hand_first/views/stock_move_line.xml | 10 ++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 stock_lot_on_hand_first/models/stock_move_line.py diff --git a/stock_lot_on_hand_first/models/__init__.py b/stock_lot_on_hand_first/models/__init__.py index db5a5edb3ca9..d06078420158 100644 --- a/stock_lot_on_hand_first/models/__init__.py +++ b/stock_lot_on_hand_first/models/__init__.py @@ -1,4 +1,5 @@ from . import stock_move +from . import stock_move_line from . import stock_picking from . import stock_picking_type from . import stock_lot diff --git a/stock_lot_on_hand_first/models/stock_move_line.py b/stock_lot_on_hand_first/models/stock_move_line.py new file mode 100644 index 000000000000..edf19620c810 --- /dev/null +++ b/stock_lot_on_hand_first/models/stock_move_line.py @@ -0,0 +1,12 @@ +# Copyright 2024 360ERP () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) + +from odoo import fields, models + + +class StockMoveLine(models.Model): + _inherit = "stock.move.line" + + display_lots_on_hand_first = fields.Boolean( + related="move_id.display_lots_on_hand_first", + ) diff --git a/stock_lot_on_hand_first/views/stock_move_line.xml b/stock_lot_on_hand_first/views/stock_move_line.xml index a5a4c8b71b3c..c32a260f75b8 100644 --- a/stock_lot_on_hand_first/views/stock_move_line.xml +++ b/stock_lot_on_hand_first/views/stock_move_line.xml @@ -5,11 +5,14 @@ stock.move.line + + + {'name_search_qty_on_hand_first': parent.display_lots_on_hand_first} + >{'name_search_qty_on_hand_first': display_lots_on_hand_first} @@ -27,11 +30,14 @@ ref="stock.view_stock_move_line_detailed_operation_tree" /> + + + {'name_search_qty_on_hand_first': parent.display_lots_on_hand_first} + >{'name_search_qty_on_hand_first': display_lots_on_hand_first}