summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-01-02 16:25:28 +0100
committerAaron Bohy <aab@odoo.com>2018-01-26 19:26:03 +0100
commitd18d08f01a589053e40c7af1fd4dd59c13aaa625 (patch)
tree63a243bccee505c4263fe441357946401cf7985e /addons/web/static/src/js/views/basic/basic_controller.js
parentaf2686fee55b20d74ce1799aea84bf1910b20051 (diff)
[IMP] web: Kanban: quick create record with more fields
This rev. improves the QuickCreate widget for grouped Kanban views. It allows specifying in the Kanban arch a form view xmlid, e.g.: <kanban quick_create_view="some_form_view_xmlid"> ... </kanban> When this attribute is set, the referenced form view is loaded and rendered inside the QuickCreate widget. A real FormView widget is instantiated, meaning that all form view mechanisms are available in the QuickCreate (modifiers, default_get, onchanges, widgets...). Task #27475.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
-rw-r--r--addons/web/static/src/js/views/basic/basic_controller.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js
index 2c7c1c40210..c4dff8fad2e 100644
--- a/addons/web/static/src/js/views/basic/basic_controller.js
+++ b/addons/web/static/src/js/views/basic/basic_controller.js
@@ -68,7 +68,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, {
* rejected otherwise
*/
canBeDiscarded: function (recordID) {
- if (!this.model.isDirty(recordID || this.handle)) {
+ if (!this.isDirty(recordID)) {
return $.when(false);
}
@@ -121,6 +121,15 @@ var BasicController = AbstractController.extend(FieldManagerMixin, {
return [];
},
/**
+ * Returns true iff the given recordID (or the main recordID) is dirty.
+ *
+ * @param {string} [recordID] - default to main recordID
+ * @returns {boolean}
+ */
+ isDirty: function (recordID) {
+ return this.model.isDirty(recordID || this.handle);
+ },
+ /**
* @override
*/
renderPager: function ($node, options) {