mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_widget_dropdown_dynamic: Migration to 13.0
This commit is contained in:
@@ -0,0 +1 @@
|
||||
../../../../web_widget_dropdown_dynamic
|
||||
6
setup/web_widget_dropdown_dynamic/setup.py
Normal file
6
setup/web_widget_dropdown_dynamic/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
../../../../web_widget_dropdown_dynamic_example
|
||||
6
setup/web_widget_dropdown_dynamic_example/setup.py
Normal file
6
setup/web_widget_dropdown_dynamic_example/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
@@ -1,10 +1,10 @@
|
||||
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
|
||||
# Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
"name": "Dynamic Dropdown Widget",
|
||||
"summary": "This module adds support for dynamic dropdown widget",
|
||||
"category": "Web",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "13.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Brainbean Apps OU, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/web/",
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
* In v13, ``$.when`` is going to become `Promise.resolve`
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
|
||||
* Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
|
||||
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
*/
|
||||
odoo.define("web_widget_dropdown_dynamic.basic_model", function(require) {
|
||||
@@ -24,7 +24,7 @@ odoo.define("web_widget_dropdown_dynamic.basic_model", function(require) {
|
||||
var model = fieldInfo.options.model || record.model;
|
||||
var method = fieldInfo.values || fieldInfo.options.values;
|
||||
if (!method) {
|
||||
return $.when();
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
var context = record.getContext({fieldName: fieldName});
|
||||
@@ -34,7 +34,7 @@ odoo.define("web_widget_dropdown_dynamic.basic_model", function(require) {
|
||||
context: context,
|
||||
});
|
||||
if (!hasChanged) {
|
||||
return $.when();
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return this._rpc({
|
||||
|
||||
@@ -29,7 +29,7 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||
"</form>",
|
||||
mockRPC: function(route, args) {
|
||||
if (args.method === "_get_test_field_values") {
|
||||
return $.when([["value", "Title"]]);
|
||||
return Promise.resolve([["value", "Title"]]);
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
@@ -61,7 +61,7 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||
"</form>",
|
||||
mockRPC: function(route, args) {
|
||||
if (args.method === "_get_test_field_values") {
|
||||
return $.when([[0, "Title"]]);
|
||||
return Promise.resolve([[0, "Title"]]);
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
@@ -95,7 +95,7 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||
"</form>",
|
||||
mockRPC: function(route, args) {
|
||||
if (args.method === "_get_test_field_values") {
|
||||
return $.when([["value", "Title"]]);
|
||||
return Promise.resolve([["value", "Title"]]);
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
@@ -130,14 +130,14 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||
mockRPC: function(route, args) {
|
||||
if (args.method === "_get_test_field_values") {
|
||||
if (args.kwargs.context.step === "step-1") {
|
||||
return $.when([["value", "Title"]]);
|
||||
return Promise.resolve([["value", "Title"]]);
|
||||
} else if (args.kwargs.context.step === "step-2") {
|
||||
return $.when([
|
||||
return Promise.resolve([
|
||||
["value", "Title"],
|
||||
["value_2", "Title 2"],
|
||||
]);
|
||||
}
|
||||
return $.when([]);
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
|
||||
# Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
"name": "Dynamic Dropdown Widget: Example",
|
||||
"summary": "Demonstration of web_widget_dropdown_dynamic",
|
||||
"category": "Web",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "13.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Brainbean Apps OU, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/web/",
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
>
|
||||
<field name="name">web_widget_dropdown_dynamic Demo</field>
|
||||
<field name="res_model">web.widget.dropdown.dynamic.example</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
|
||||
Reference in New Issue
Block a user