From 7b29e9d70fa4c7af2ddd9a224485979bcef2a0ff Mon Sep 17 00:00:00 2001 From: boan-odoo Date: Fri, 28 Jan 2022 10:53:27 +0000 Subject: [PATCH] [IMP] stock: explain removal strategies in help-text Ref: https://drive.google.com/file/d/1ObNPHzl8fIeNtmRIMLT60KtHJqOhrd0r/view Note: also added contextual help to the second occurrence of the "Removal Strategy" combo in `Configuration>Product categories>...>Force Removal Strategy`. closes odoo/odoo#83829 Task: 2654703-1 X-original-commit: 4bae10e0d960e5b80055e0e44056493238e552d3 Signed-off-by: Arnold Moyaux --- addons/stock/i18n/stock.pot | 18 ++++++++++++------ addons/stock/models/product.py | 8 +++++++- addons/stock/models/stock_location.py | 12 +++++++++++- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 3e985401f66..8890c3ffc0e 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -1940,10 +1940,12 @@ msgstr "" #. module: stock #: model:ir.model.fields,help:stock.field_stock_location__removal_strategy_id msgid "" -"Defines the default method used for suggesting the exact location (shelf) " -"where to take the products from, which lot etc. for this location. This " -"method can be enforced at the product category level, and a fallback is made" -" on the parent locations if none is set here." +"Defines the default method used for suggesting the exact location (shelf) where to take the products from, which lot etc. for this location. This method can be enforced at the product category level, and a fallback is made on the parent locations if none is set here.\n" +"\n" +"FIFO: products/lots that were stocked first will be moved out first.\n" +"LIFO: products/lots that were stocked last will be moved out first.\n" +"Closet location: products/lots closest to the target location will be moved out first.\n" +"FEFO: products/lots with the closest removal date will be moved out first (the availability of this method depends on the \"Expiration Dates\" setting)." msgstr "" #. module: stock @@ -6496,8 +6498,12 @@ msgstr "" #. module: stock #: model:ir.model.fields,help:stock.field_product_category__removal_strategy_id msgid "" -"Set a specific removal strategy that will be used regardless of the source " -"location for this product category" +"Set a specific removal strategy that will be used regardless of the source location for this product category.\n" +"\n" +"FIFO: products/lots that were stocked first will be moved out first.\n" +"LIFO: products/lots that were stocked last will be moved out first.\n" +"Closet location: products/lots closest to the target location will be moved out first.\n" +"FEFO: products/lots with the closest removal date will be moved out first (the availability of this method depends on the \"Expiration Dates\" setting)." msgstr "" #. module: stock diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index f36f2a2203d..1e7b130b893 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -965,7 +965,13 @@ class ProductCategory(models.Model): domain=[('product_categ_selectable', '=', True)]) removal_strategy_id = fields.Many2one( 'product.removal', 'Force Removal Strategy', - help="Set a specific removal strategy that will be used regardless of the source location for this product category") + help="Set a specific removal strategy that will be used regardless of the source location for this product category.\n\n" + "FIFO: products/lots that were stocked first will be moved out first.\n" + "LIFO: products/lots that were stocked last will be moved out first.\n" + "Closet location: products/lots closest to the target location will be moved out first.\n" + "FEFO: products/lots with the closest removal date will be moved out first " + "(the availability of this method depends on the \"Expiration Dates\" setting)." + ) total_route_ids = fields.Many2many( 'stock.route', string='Total routes', compute='_compute_total_route_ids', readonly=True) diff --git a/addons/stock/models/stock_location.py b/addons/stock/models/stock_location.py index ea762641f87..d9bf30b4172 100644 --- a/addons/stock/models/stock_location.py +++ b/addons/stock/models/stock_location.py @@ -69,7 +69,17 @@ class Location(models.Model): help='Let this field empty if this location is shared between companies') scrap_location = fields.Boolean('Is a Scrap Location?', default=False, help='Check this box to allow using this location to put scrapped/damaged goods.') return_location = fields.Boolean('Is a Return Location?', help='Check this box to allow using this location as a return location.') - removal_strategy_id = fields.Many2one('product.removal', 'Removal Strategy', help="Defines the default method used for suggesting the exact location (shelf) where to take the products from, which lot etc. for this location. This method can be enforced at the product category level, and a fallback is made on the parent locations if none is set here.") + removal_strategy_id = fields.Many2one( + 'product.removal', 'Removal Strategy', + help="Defines the default method used for suggesting the exact location (shelf) " + "where to take the products from, which lot etc. for this location. " + "This method can be enforced at the product category level, " + "and a fallback is made on the parent locations if none is set here.\n\n" + "FIFO: products/lots that were stocked first will be moved out first.\n" + "LIFO: products/lots that were stocked last will be moved out first.\n" + "Closet location: products/lots closest to the target location will be moved out first.\n" + "FEFO: products/lots with the closest removal date will be moved out first " + "(the availability of this method depends on the \"Expiration Dates\" setting).") putaway_rule_ids = fields.One2many('stock.putaway.rule', 'location_in_id', 'Putaway Rules') barcode = fields.Char('Barcode', copy=False) quant_ids = fields.One2many('stock.quant', 'location_id')