diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-01-26 20:24:55 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-01-26 20:24:55 +0100 |
| commit | 16b8f2136b90080d280602317e7f91690e113121 (patch) | |
| tree | f6c148967e304d1ba0acc78dba6342089a92a3d7 /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | cb339842d4d8b19f3870127c00a6868af2e95004 (diff) | |
| parent | fbb6942326bb6be120e300032df40ca4c72fc72b (diff) | |
[MERGE] web,*: Kanban QuickCreate widgets improvement
*: mainly crm, hr_recruitment and project
This branch improves the RecordQuickCreate and ColumnQuickCreate
widgets of the Kanban view, in order to ease user onboarding.
The RecordQuickCreate is no longer limited to the display_name: it
instantiates a real form view, whose xmlid has to be referenced in the
root node of the Kanban arch (attribute 'quick_create_view'). This
branch already defines quick create form views for models 'crm.lead',
'hr.applicant' and 'project.task'.
The ColumnQuickCreate's main change is that it may now contain a link
leading to a dialog with examples of how to configure the columns (by
specifying a JS registry key under attribute 'examples' in the root node
of the Kanban arch, and by defining the examples to display in the
dialog in that registry). Examples have already been specified for the
'project.task' Kanban view. Several other tweaks have been done on the
ColumnQuickCreate (e.g. it now opens directly in grouped Kanban views
with no column, its style has been improved...)
Tasks #27475 and #38740.
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.js | 11 |
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) { |
