Skip to content

Commit

Permalink
[IMP] stock_weighing: open groupby record
Browse files Browse the repository at this point in the history
Add an access to the groupby record (if it's a related one) to be able
to access to its full info.

TT52202
  • Loading branch information
chienandalu committed Dec 16, 2024
1 parent a41fcaa commit 97ff421
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const WeightRecordingKanbanColumn = KanbanColumn.extend({
events: _.extend({}, KanbanColumn.prototype.events || {}, {
"click .toggle_kanban_fold": "_onToggleFold",
"click .column_print_labels": "_onPrintLabels",
"click .o_column_open": "_onOpenColumn",
}),
/**
* Show print button only when there are operations to print
Expand All @@ -31,6 +32,24 @@ export const WeightRecordingKanbanColumn = KanbanColumn.extend({
event.preventDefault();
this.trigger_up("column_print_labels");
},
/**
* Opens the related form view.
*
* @private
* @param {OdooEvent} ev
*/
_onOpenColumn(event) {
event.preventDefault();
this.do_action({
context: {create: false},
type: "ir.actions.act_window",
target: "current",
views: [[false, "form"]],
res_model: this.relation,
res_id: this.id,
view_mode: "form",
});
},
});

export const WeightRecordingKanbanController = KanbanController.extend({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
</button>
</t>
<t t-jquery=".o_column_unfold" t-operation="replace" />
<t t-jquery="span.o_column_title" t-operation="after">
<t t-if="widget.grouped_by_m2o and widget.id">
<a
role="image"
class="ml-1 fa fa-external-link o_column_open"
href="#"
/>
</t>
</t>
</t>

</templates>

0 comments on commit 97ff421

Please sign in to comment.