Skip to content

Commit

Permalink
[FIX] mrp_production_batch: Fix to allow the dashboard's tree view to…
Browse files Browse the repository at this point in the history
… open forms.
  • Loading branch information
FrankC013 committed Dec 18, 2023
1 parent a002267 commit a182fd1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 23 deletions.
5 changes: 3 additions & 2 deletions mrp_production_batch/models/stock_picking_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ def _compute_mo_batch_count(self):

def mrp_production_batch_action(self):
tree_view = self.env.ref("mrp_production_batch.mrp_production_batch_tree_view")
form_view = self.env.ref("mrp_production_batch.mrp_production_batch_form_view")
return {

Check warning on line 69 in mrp_production_batch/models/stock_picking_type.py

View check run for this annotation

Codecov / codecov/patch

mrp_production_batch/models/stock_picking_type.py#L67-L69

Added lines #L67 - L69 were not covered by tests
"name": ("Detailed Operations"),
"type": "ir.actions.act_window",
"view_mode": "tree",
"view_mode": "tree,form",
"res_model": "mrp.production.batch",
"views": [(tree_view.id, "tree")],
"views": [(tree_view.id, "tree"), (form_view.id, "form")],
"view_id": tree_view.id,
"domain": [("id", "in", self.mo_batches.ids)],
}
55 changes: 34 additions & 21 deletions mrp_production_batch/views/stock_picking_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,30 @@
<field name="name" />
</a>
</div>
<span class="o_primary" t-if="selection_mode"><field
name="name"
/></span>
<div class="o_secondary"><field
<span class="o_primary" t-if="selection_mode">
<field name="name" />
</span>
<div class="o_secondary">
<field
class="o_secondary"
name="warehouse_id"
readonly="1"
groups="stock.group_stock_multi_warehouses"
/></div>
/>
</div>
</div>
<div
class="o_kanban_manage_button_section"
t-if="!selection_mode"
>
<a class="o_kanban_manage_toggle_button" href="#"><i
<a class="o_kanban_manage_toggle_button" href="#">
<i
class="fa fa-ellipsis-v"
role="img"
aria-label="Manage"
title="Manage"
/></a>
/>
</a>
</div>
</div>
<div
Expand All @@ -53,17 +57,19 @@
>
<div class="row">
<div class="col-6 o_kanban_primary_left">

<button
<button
class="btn btn-primary"
name="mrp_production_batch_action"
type="object"
>

<span t-if="record.code.raw_value =='mrp_operation_batch'">
<t t-esc="record.mo_batch_count.value" /> To Process
</span>
</button>
<span
t-if="record.code.raw_value =='mrp_operation_batch'"
>
<t
t-esc="record.mo_batch_count.value"
/> To Process
</span>
</button>

<!-- <button class="btn btn-primary" name="%(mrp_production_batch_action_picking_dashboard)d" type="action" context="{'search_default_todo': 1, 'default_picking_type_id': active_id}">-->
<!-- <span t-if="record.code.raw_value =='mrp_operation_batch'"> <t t-esc="record.mo_todo_wo_batch_count.value" /> To Process</span>-->
Expand Down Expand Up @@ -105,7 +111,8 @@
</div>
</div>
</div>
</div><div
</div>
<div
class="container o_kanban_card_manage_pane dropdown-menu"
role="menu"
>
Expand All @@ -124,21 +131,27 @@
<a
name="%(mrp_production_batch_action_picking_dashboard)d"
type="action"
>All</a>
>
All
</a>
</div>
<div role="menuitem">
<a
name="%(mrp_production_batch_action_picking_dashboard)d"
type="action"
context="{'search_default_inprogress': 1}"
>In Progress</a>
>
In Progress
</a>
</div>
<div role="menuitem">
<a
name="%(mrp_production_batch_action_picking_dashboard)d"
type="action"
context="{'search_default_planned': 1}"
>Planned</a>
>
Planned
</a>
</div>
</div>
<div
Expand All @@ -152,7 +165,6 @@
</div>
</div>
</div>

<div
t-if="widget.editable"
class="o_kanban_card_manage_settings row"
Expand All @@ -169,14 +181,15 @@
class="dropdown-item"
role="menuitem"
type="edit"
>Configuration</a>
>
Configuration
</a>
</div>
</div>
</div>
</div>
</div>
</xpath>

<xpath expr="//t[@t-esc='record.count_mo_todo.value']" position="after">
<t t-esc="record.count_mo_todo_wo_batch.value" />
</xpath>
Expand Down

0 comments on commit a182fd1

Please sign in to comment.