mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_widget_domain_editor_dialog: Migration to 15.0
This commit is contained in:
@@ -4,12 +4,11 @@
|
||||
odoo.define("web_widget_domain_editor_dialog.basic_fields", function (require) {
|
||||
"use strict";
|
||||
|
||||
const core = require("web.core");
|
||||
const basic_fields = require("web.basic_fields");
|
||||
const {_t} = require("web.core");
|
||||
const {FieldDomain} = require("web.basic_fields");
|
||||
const DomainEditorDialog = require("web_widget_domain_editor_dialog.DomainEditorDialog");
|
||||
const _t = core._t;
|
||||
|
||||
basic_fields.FieldDomain.include({
|
||||
FieldDomain.include({
|
||||
_onShowSelectionButtonClick: function (event) {
|
||||
event.preventDefault();
|
||||
const _this = this;
|
||||
@@ -30,9 +29,11 @@ odoo.define("web_widget_domain_editor_dialog.basic_fields", function (require) {
|
||||
_this.domainSelector
|
||||
.setDomain(this.get_domain(selected_ids))
|
||||
.then(_this._replaceContent.bind(_this));
|
||||
_this.trigger_up("domain_changed", {
|
||||
// Trigger from domainSelector instead of _this
|
||||
// for execute https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/legacy/js/widgets/domain_selector.js#L623
|
||||
_this.domainSelector.trigger_up("domain_changed", {
|
||||
child: _this,
|
||||
alreadyRedrawn: true,
|
||||
noRedraw: true,
|
||||
});
|
||||
},
|
||||
}).open();
|
||||
|
||||
@@ -4,21 +4,19 @@
|
||||
odoo.define("web_widget_domain_editor_dialog.DomainEditorDialog", function (require) {
|
||||
"use strict";
|
||||
|
||||
const core = require("web.core");
|
||||
const view_dialogs = require("web.view_dialogs");
|
||||
const {_t} = require("web.core");
|
||||
const {SelectCreateDialog} = require("web.view_dialogs");
|
||||
const Domain = require("web.Domain");
|
||||
const _t = core._t;
|
||||
|
||||
const DomainEditorDialog = view_dialogs.SelectCreateDialog.extend({
|
||||
const DomainEditorDialog = SelectCreateDialog.extend({
|
||||
init: function () {
|
||||
this._super.apply(this, arguments);
|
||||
const _this = this;
|
||||
this.options = _.defaults(this.options, {
|
||||
dynamicFilters: [
|
||||
{
|
||||
description: _.str.sprintf(_t("Selected domain")),
|
||||
description: _t("Selected domain"),
|
||||
domain: Domain.prototype.stringToArray(
|
||||
_this.options.default_domain
|
||||
this.options.default_domain
|
||||
),
|
||||
},
|
||||
],
|
||||
@@ -62,7 +60,7 @@ odoo.define("web_widget_domain_editor_dialog.DomainEditorDialog", function (requ
|
||||
return domain.concat(group_domain);
|
||||
},
|
||||
|
||||
on_view_list_loaded: () => {
|
||||
on_view_list_loaded: function () {
|
||||
this.$(".o_list_record_selector input").prop("checked", true);
|
||||
this.$footer
|
||||
.find(".o_selectcreatepopup_search_select")
|
||||
|
||||
Reference in New Issue
Block a user