-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] web_advanced_search. Restore 'in selection' operator
- Loading branch information
Showing
4 changed files
with
104 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ | |
* `DynApps NV <https://www.dynapps.be>`_: | ||
|
||
* Raf Ven | ||
|
||
* `Therp BV <https://therp.nl>`_: | ||
|
||
* Ronald Portier |
51 changes: 51 additions & 0 deletions
51
web_advanced_search/static/src/js/control_panel/advanced_select_dialog.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,51 @@ | ||
odoo.define("web_advanced_search.AdvancedSelectDialog", function (require) { | ||
"use strict"; | ||
|
||
const { _lt, _t } = require("web.core"); | ||
const Context = require("web.Context"); | ||
const dialogs = require("web.view_dialogs"); | ||
|
||
const AdvancedSelectDialog = dialogs.SelectCreateDialog.extend({ | ||
/** | ||
* prepare buttons for dialog footer based on options | ||
* | ||
* Fully overide funtion to just show Select and Use Criteria. | ||
* | ||
* @private | ||
*/ | ||
_prepareButtons: function () { | ||
this.__buttons = [ | ||
{ | ||
text: _t("Select"), | ||
classes: "btn-primary o_select_button", | ||
disabled: true, | ||
close: true, | ||
click: function () { | ||
const records = this.viewController.getSelectedRecords(); | ||
const ids = records.map(record => record.res_id); | ||
const names = records.map(record => record.data.display_name); | ||
this.trigger_up( | ||
"domain_selected", | ||
{ domain: [['id', 'in', ids]], names: names } | ||
); | ||
}, | ||
}, | ||
{ | ||
text: _t("Use criteria"), | ||
classes: "btn-primary", | ||
// TODO: get somehow the criteria selected... | ||
click: this.create_edit_record.bind(this) | ||
}, | ||
{ | ||
text: _t("Cancel"), | ||
classes: "btn-secondary o_form_button_cancel", | ||
close: true, | ||
}, | ||
]; | ||
}, | ||
}); | ||
|
||
return { | ||
AdvancedSelectDialog: AdvancedSelectDialog | ||
}; | ||
}); |
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,13 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- Copyright 2017-2018 Jairo Llopis <[email protected]> | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
--> | ||
<odoo> | ||
<template id="assets_backend" inherit_id="web.assets_backend"> | ||
<xpath expr="." position="inside"> | ||
<script | ||
type="text/javascript" | ||
src="/web_advanced_search/static/src/js/control_panel/advanced_filter_item.js" | ||
/> | ||
<script | ||
type="text/javascript" | ||
src="/web_advanced_search/static/src/js/control_panel/advanced_select_dialog.js" | ||
/> | ||
<script | ||
type="text/javascript" | ||
src="/web_advanced_search/static/src/js/control_panel/filter_menu.js" | ||
|