From f31aa712016ad9b01fb14bbb553d2055cb27efa0 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 17 Apr 2024 16:37:00 +0200 Subject: [PATCH] [DON'T MERGE] unreleased deps --- stock_secondary_unit_weighing/models/__init__.py | 1 + .../models/stock_move.py | 16 ++++++++++++++++ test-requirements.txt | 1 + 3 files changed, 18 insertions(+) create mode 100644 stock_secondary_unit_weighing/models/stock_move.py create mode 100644 test-requirements.txt diff --git a/stock_secondary_unit_weighing/models/__init__.py b/stock_secondary_unit_weighing/models/__init__.py index 431f51c2..f800274c 100644 --- a/stock_secondary_unit_weighing/models/__init__.py +++ b/stock_secondary_unit_weighing/models/__init__.py @@ -1 +1,2 @@ +from . import stock_move from . import stock_move_line diff --git a/stock_secondary_unit_weighing/models/stock_move.py b/stock_secondary_unit_weighing/models/stock_move.py new file mode 100644 index 00000000..c3d36773 --- /dev/null +++ b/stock_secondary_unit_weighing/models/stock_move.py @@ -0,0 +1,16 @@ +# Copyright 2024 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class StockMove(models.Model): + _inherit = "stock.move" + + def action_add_move_line(self): + action = super().action_add_move_line() + if self.secondary_uom_id: + extra_info = ( + f"[{self.secondary_uom_id.display_name} - {self.secondary_uom_qty}]" + ) + action["name"] = f'{action["name"]} {extra_info}' + return action diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..1a8e0fa6 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-stock_weighing @ git+https://github.com/OCA/stock-weighing.git@refs/pull/1/head#subdirectory=setup/stock_weighing