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 authored and LoisRForgeFlow committed Oct 23, 2023
1 parent 7004a52 commit 4f69105
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
4 changes: 4 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,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,
Expand Down
24 changes: 20 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" groups="stock.group_stock_multi_locations" />
<field name="company_id" groups="base.group_multi_company" />
</tree>
</field>
Expand All @@ -25,10 +27,22 @@
<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"
groups="stock.group_stock_multi_locations"
/>
<field
name="company_id"
groups="base.group_multi_company"
/>
</group>
</group>
</sheet>
</form>
Expand All @@ -40,6 +54,8 @@
<field name="arch" type="xml">
<search>
<field name="buffer_id" />
<field name="product_id" />
<field name="location_id" groups="stock.group_stock_multi_locations" />
<field name="severity" />
<separator />
<group expand="0" string="Group By">
Expand Down

0 comments on commit 4f69105

Please sign in to comment.