Skip to content

Commit

Permalink
[IMP] scrummer: add button from task to go in task project
Browse files Browse the repository at this point in the history
  • Loading branch information
mathben committed Jan 19, 2020
1 parent 3fbedb0 commit ba84cd7
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
11 changes: 11 additions & 0 deletions scrummer/static/src/js/views/backlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,13 @@ odoo.define('scrummer.view.backlog', function (require) {
},
},
menuItems: [
{
class: "open-in-project",
icon: "mdi-briefcase",
text: _t("Open in project"),
callback: '_onOpenInProject',
sequence: 0,
},
{
class: "assign-to-me",
icon: "mdi-account-check",
Expand Down Expand Up @@ -564,6 +571,10 @@ odoo.define('scrummer.view.backlog', function (require) {
options: {id: this.record.id, isQuickDetailView: true}
});
},
_onOpenInProject() {
var newUrl = "http://" + window.location.host + "/web?#id=" + this.record.id + "&model=project.task&view_type=form";
window.location.href = newUrl;
},
_onAssignToMeClick() {
this.record.user_id = data.session.uid;
},
Expand Down
11 changes: 11 additions & 0 deletions scrummer/static/src/js/views/kanban_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ odoo.define('scrummer.view.kanban_table', function (require) {
});
var TaskCard = AbstractCard.extend({
menuItems: [
{
class: "open-in-project",
icon: "mdi-briefcase",
text: _t("Open in project"),
callback: '_onOpenInProject',
sequence: 0,
},
{
class: "assign-to-me",
icon: "mdi-account-check",
Expand Down Expand Up @@ -383,6 +390,10 @@ odoo.define('scrummer.view.kanban_table', function (require) {
});
newItemModal.appendTo($("body"));
},
_onOpenInProject() {
var newUrl = "http://" + window.location.host + "/web?#id=" + this.task.id + "&model=project.task&view_type=form";
window.location.href = newUrl;
},
_onAssignToMeClick() {
this.task.user_id = data.session.uid;
// data.cache.get("current_user").then(user => {
Expand Down
12 changes: 11 additions & 1 deletion scrummer/static/src/js/views/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ odoo.define('scrummer.view.task', function (require) {
_name: "TaskView",
template: "scrummer.view.task",
menuItems: [
{
class: "open-in-project",
icon: "mdi-briefcase",
text: _t("Open in project"),
callback: '_onOpenInProject',
sequence: 0,
},
{
class: "assign-to-me",
icon: "mdi-account-check",
Expand Down Expand Up @@ -192,7 +199,10 @@ odoo.define('scrummer.view.task', function (require) {
collapseEffect: "fadeOut"
});
},

_onOpenInProject() {
var newUrl = "http://" + window.location.host + "/web?#id=" + this.taskId + "&model=project.task&view_type=form";
window.location.href = newUrl;
},
_onAssignToMeClick() {
this.taskWidget._model.user_id = data.session.uid;
},
Expand Down
11 changes: 11 additions & 0 deletions scrummer/static/src/js/widgets/task_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ odoo.define('scrummer.widget.task', function (require) {
_name: "TaskWidget",
template: "scrummer.task",
menuItems: [
{
class: "open-in-project",
icon: "mdi-briefcase",
text: _t("Open in project"),
callback: '_onOpenInProject',
sequence: 0,
},
{
class: "assign-to-me",
icon: "mdi-account-check",
Expand Down Expand Up @@ -407,6 +414,10 @@ odoo.define('scrummer.widget.task', function (require) {
removeParent() {
this.$(".parent-key").hide();
},
_onOpenInProject() {
var newUrl = "http://" + window.location.host + "/web?#id=" + this._model.id + "&model=project.task&view_type=form";
window.location.href = newUrl;
},
_onAssignToMeClick() {
this._model.user_id = data.session.uid;
},
Expand Down

0 comments on commit ba84cd7

Please sign in to comment.