Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][IMP] stock_weighing: open groupby record #24

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -69,6 +69,10 @@
display: none;
}
.o_kanban_header_title {
.o_column_open {
font-size: 1.3rem;
font-weight: bold;
}
.o_column_title {
cursor: initial;
}
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.folded and 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>
Loading