From 32339eb3fa9cb14dedb991e4fd43c0be3bd858c3 Mon Sep 17 00:00:00 2001 From: BernatPForgeFlow Date: Fri, 15 Sep 2023 17:09:59 +0200 Subject: [PATCH] [IMP] ddmrp_warning: Add product/location info in warnings --- ddmrp_warning/models/ddmrp_warning_item.py | 4 ++++ .../views/ddmrp_warning_item_views.xml | 24 +++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ddmrp_warning/models/ddmrp_warning_item.py b/ddmrp_warning/models/ddmrp_warning_item.py index 497509c07..1cf708804 100644 --- a/ddmrp_warning/models/ddmrp_warning_item.py +++ b/ddmrp_warning/models/ddmrp_warning_item.py @@ -16,6 +16,10 @@ class DdmrpWarningItem(models.Model): name = fields.Char( compute="_compute_name", ) + product_id = fields.Many2one(related="buffer_id.product_id") + location_id = fields.Many2one( + related="buffer_id.location_id", groups="stock.group_stock_multi_locations" + ) severity = fields.Selection( related="warning_definition_id.severity", store=True, diff --git a/ddmrp_warning/views/ddmrp_warning_item_views.xml b/ddmrp_warning/views/ddmrp_warning_item_views.xml index 60f4a3e1b..4bf6c12e3 100644 --- a/ddmrp_warning/views/ddmrp_warning_item_views.xml +++ b/ddmrp_warning/views/ddmrp_warning_item_views.xml @@ -13,7 +13,9 @@ decoration-danger="severity == '3_high'" > + + @@ -25,10 +27,22 @@
- - - - + + + + + + + + + +
@@ -40,6 +54,8 @@ + +