-
-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG]: base_tier_validation: Migration to 16
- Loading branch information
1 parent
8979568
commit 1347ee4
Showing
27 changed files
with
661 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from odoo import fields, models | ||
from odoo import models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
module_base_tier_validation_formula = fields.Boolean(string="Tier Formula") | ||
module_base_tier_validation_forward = fields.Boolean("Tier Forward & Backward") | ||
module_base_tier_validation_server_action = fields.Boolean("Tier Server Action") | ||
module_base_tier_validation_report = fields.Boolean("Tier Reports") | ||
# Activate me back when modules are migrated | ||
|
||
# module_base_tier_validation_formula = fields.Boolean(string="Tier Formula") | ||
# module_base_tier_validation_forward = fields.Boolean("Tier Forward & Backward") | ||
# module_base_tier_validation_server_action = fields.Boolean("Tier Server Action") | ||
# module_base_tier_validation_report = fields.Boolean("Tier Reports") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** @odoo-module **/ | ||
|
||
import {registerModel} from "@mail/model/model_core"; | ||
import {attr, one} from "@mail/model/model_field"; | ||
|
||
registerModel({ | ||
name: "ir.model.review", | ||
fields: { | ||
/** | ||
* Determines the name of the views that are available for this model. | ||
*/ | ||
availableWebViews: attr({ | ||
compute() { | ||
return ["kanban", "list", "form", "activity"]; | ||
}, | ||
}), | ||
reviewGroup: one("ReviewGroup", { | ||
inverse: "irModel", | ||
}), | ||
iconUrl: attr(), | ||
id: attr({ | ||
identifying: true, | ||
}), | ||
model: attr({ | ||
required: true, | ||
}), | ||
name: attr(), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @odoo-module **/ | ||
|
||
import {systrayService} from "@base_tier_validation/js/systray_service.esm"; | ||
|
||
import {registry} from "@web/core/registry"; | ||
|
||
const serviceRegistry = registry.category("services"); | ||
serviceRegistry.add("review_systray_service", systrayService); |
46 changes: 46 additions & 0 deletions
46
base_tier_validation/static/src/js/review_group_view.esm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** @odoo-module **/ | ||
|
||
import {registerModel} from "@mail/model/model_core"; | ||
import {one} from "@mail/model/model_field"; | ||
|
||
registerModel({ | ||
name: "ReviewGroupView", | ||
recordMethods: { | ||
/** | ||
* @param {MouseEvent} ev | ||
*/ | ||
onClickFilterButton(ev) { | ||
this.reviewMenuViewOwner.update({isOpen: false}); | ||
// Fetch the data from the button otherwise fetch the ones from the parent (.o_ActivityMenuView_activityGroup). | ||
const data = _.extend({}, $(ev.currentTarget).data(), $(ev.target).data()); | ||
const context = {}; | ||
|
||
this.env.services.action.doAction( | ||
{ | ||
context, | ||
name: data.model_name, | ||
res_model: data.res_model, | ||
search_view_id: [false], | ||
type: "ir.actions.act_window", | ||
domain: [["can_review", "=", true]], | ||
views: this.reviewGroup.irModel.availableWebViews.map( | ||
(viewName) => [false, viewName] | ||
), | ||
}, | ||
{ | ||
clearBreadcrumbs: true, | ||
} | ||
); | ||
}, | ||
}, | ||
fields: { | ||
reviewGroup: one("ReviewGroup", { | ||
identifying: true, | ||
inverse: "reviewGroupViews", | ||
}), | ||
reviewMenuViewOwner: one("ReviewerMenuView", { | ||
identifying: true, | ||
inverse: "reviewGroupViews", | ||
}), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** @odoo-module **/ | ||
|
||
import {registerModel} from "@mail/model/model_core"; | ||
import {attr, many, one} from "@mail/model/model_field"; | ||
|
||
registerModel({ | ||
name: "ReviewGroup", | ||
modelMethods: { | ||
convertData(data) { | ||
return { | ||
domain: data.domain, | ||
irModel: { | ||
iconUrl: data.icon, | ||
id: data.id, | ||
model: data.model, | ||
name: data.name, | ||
}, | ||
pending_count: data.pending_count, | ||
}; | ||
}, | ||
}, | ||
recordMethods: { | ||
/** | ||
* @private | ||
*/ | ||
_onChangePendingCount() { | ||
if (this.type === "tier_review" && this.pending_count === 0) { | ||
this.delete(); | ||
} | ||
}, | ||
}, | ||
fields: { | ||
reviewGroupViews: many("ReviewGroupView", { | ||
inverse: "reviewGroup", | ||
}), | ||
domain: attr(), | ||
irModel: one("ir.model.review", { | ||
identifying: true, | ||
inverse: "reviewGroup", | ||
}), | ||
pending_count: attr({ | ||
default: 0, | ||
}), | ||
type: attr(), | ||
}, | ||
onChanges: [ | ||
{ | ||
dependencies: ["pending_count", "type"], | ||
methodName: "_onChangePendingCount", | ||
}, | ||
], | ||
}); |
Oops, something went wrong.