Skip to content

Commit

Permalink
[IMP] ddmrp_warning: Add product/location info in warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BernatPForgeFlow committed Sep 15, 2023
1 parent bfb7db6 commit 6fce697
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ddmrp_warning/models/ddmrp_warning_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ 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")
severity = fields.Selection(
related="warning_definition_id.severity",
store=True,
Expand Down
21 changes: 17 additions & 4 deletions ddmrp_warning/views/ddmrp_warning_item_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
decoration-danger="severity == '3_high'"
>
<field name="name" />
<field name="product_id" />
<field name="severity" />
<field name="location_id" />
<field name="company_id" groups="base.group_multi_company" />
</tree>
</field>
Expand All @@ -25,10 +27,19 @@
<form>
<sheet>
<group>
<field name="warning_definition_id" />
<field name="buffer_id" />
<field name="severity" />
<field name="company_id" groups="base.group_multi_company" />
<group>
<field name="warning_definition_id" />
<field name="buffer_id" />
<field name="severity" />
</group>
<group>
<field name="product_id" />
<field name="location_id" />
<field
name="company_id"
groups="base.group_multi_company"
/>
</group>
</group>
</sheet>
</form>
Expand All @@ -40,6 +51,8 @@
<field name="arch" type="xml">
<search>
<field name="buffer_id" />
<field name="product_id" />
<field name="location_id" />
<field name="severity" />
<separator />
<group expand="0" string="Group By">
Expand Down

0 comments on commit 6fce697

Please sign in to comment.