diff --git a/addons/web/static/tests/views/kanban_tests.js b/addons/web/static/tests/views/kanban_tests.js
index 200216d03e5..30290114e29 100644
--- a/addons/web/static/tests/views/kanban_tests.js
+++ b/addons/web/static/tests/views/kanban_tests.js
@@ -1218,6 +1218,81 @@ QUnit.module('Views', {
kanban.destroy();
});
+ QUnit.test('quick create record in grouped on date(time) field', function (assert) {
+ assert.expect(6);
+
+ var kanban = createView({
+ View: KanbanView,
+ model: 'partner',
+ data: this.data,
+ arch: '
' +
+ '' +
+ '
' +
+ '' +
+ '',
+ groupBy: ['date'],
+ intercepts: {
+ switch_view: function (ev) {
+ assert.deepEqual(_.pick(ev.data, 'res_id', 'view_type'), {
+ res_id: undefined,
+ view_type: 'form',
+ }, "should trigger an event to open the form view (twice)");
+ },
+ },
+ });
+
+ assert.strictEqual(kanban.$('.o_kanban_header .o_kanban_quick_add i').length, 0,
+ "quick create should be disabled when grouped on a date field");
+
+ // clicking on CREATE in control panel should not open a quick create
+ kanban.$buttons.find('.o-kanban-button-new').click();
+ assert.strictEqual(kanban.$('.o_kanban_quick_create').length, 0,
+ "should not have opened the quick create widget");
+
+ kanban.reload({groupBy: ['datetime']});
+
+ assert.strictEqual(kanban.$('.o_kanban_header .o_kanban_quick_add i').length, 0,
+ "quick create should be disabled when grouped on a datetime field");
+
+ // clicking on CREATE in control panel should not open a quick create
+ kanban.$buttons.find('.o-kanban-button-new').click();
+ assert.strictEqual(kanban.$('.o_kanban_quick_create').length, 0,
+ "should not have opened the quick create widget");
+
+ kanban.destroy();
+ });
+
+ QUnit.test('quick create record feature is properly enabled/disabled at reload', function (assert) {
+ assert.expect(3);
+
+ var kanban = createView({
+ View: KanbanView,
+ model: 'partner',
+ data: this.data,
+ arch: '
' +
+ '' +
+ '
' +
+ '' +
+ '',
+ groupBy: ['foo'],
+ });
+
+ assert.strictEqual(kanban.$('.o_kanban_header .o_kanban_quick_add i').length, 3,
+ "quick create should be enabled when grouped on a char field");
+
+ kanban.reload({groupBy: ['date']});
+
+ assert.strictEqual(kanban.$('.o_kanban_header .o_kanban_quick_add i').length, 0,
+ "quick create should now be disabled (grouped on date field)");
+
+ kanban.reload({groupBy: ['bar']});
+
+ assert.strictEqual(kanban.$('.o_kanban_header .o_kanban_quick_add i').length, 2,
+ "quick create should be enabled again (grouped on boolean field)");
+
+ kanban.destroy();
+ });
+
QUnit.test('many2many_tags in kanban views', function (assert) {
assert.expect(12);
@@ -3568,7 +3643,7 @@ QUnit.module('Views', {
'
' +
'' +
'',
- groupBy: ['int_field'],
+ groupBy: ['foo'],
mockRPC: function (route, args) {
if (route === '/web/dataset/resequence') {
return $.when(true);
diff --git a/doc/cla/individual/rakete.md b/doc/cla/individual/rakete.md
new file mode 100644
index 00000000000..72fa2bcea7c
--- /dev/null
+++ b/doc/cla/individual/rakete.md
@@ -0,0 +1,11 @@
+Germany, 2017-11-24
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Andreas Raster lazor@affenbande.org https://github.com/rakete
diff --git a/doc/cla/individual/zoggy444.md b/doc/cla/individual/zoggy444.md
new file mode 100644
index 00000000000..46f8490f973
--- /dev/null
+++ b/doc/cla/individual/zoggy444.md
@@ -0,0 +1,11 @@
+FRANCE, 2018-09-26
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+zoggy 43614933+zoggy444@users.noreply.github.com https://github.com/zoggy444
diff --git a/doc/reference/views.rst b/doc/reference/views.rst
index cc165285915..d35af9b7b36 100644
--- a/doc/reference/views.rst
+++ b/doc/reference/views.rst
@@ -852,7 +852,7 @@ attributes:
``quick_create``
whether it should be possible to create records without switching to the
form view. By default, ``quick_create`` is enabled when the Kanban view is
- grouped, and disabled when not.
+ grouped by many2one, char or boolean fields, and disabled when not.
Set to ``true`` to always enable it, and to ``false`` to always disable it.
diff --git a/odoo/addons/base/data/base_data.sql b/odoo/addons/base/data/base_data.sql
index 30d6cc6cd89..5f907ad5b60 100644
--- a/odoo/addons/base/data/base_data.sql
+++ b/odoo/addons/base/data/base_data.sql
@@ -107,6 +107,7 @@ CREATE TABLE res_company (
name varchar NOT NULL,
partner_id integer,
currency_id integer,
+ sequence integer,
create_date timestamp without time zone,
primary key(id)
);
diff --git a/odoo/addons/base/models/ir_actions.py b/odoo/addons/base/models/ir_actions.py
index dd1fbfaf7f6..f500909d2e1 100644
--- a/odoo/addons/base/models/ir_actions.py
+++ b/odoo/addons/base/models/ir_actions.py
@@ -339,7 +339,7 @@ class IrActionsServer(models.Model):
DEFAULT_PYTHON_CODE = """# Available variables:
# - env: Odoo Environment on which the action is triggered
# - model: Odoo Model of the record on which the action is triggered; is a void recordset
-# - record: record on which the action is triggered; may be be void
+# - record: record on which the action is triggered; may be void
# - records: recordset of all records on which the action is triggered in multi-mode; may be void
# - time, datetime, dateutil, timezone: useful Python libraries
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
diff --git a/odoo/addons/base/models/ir_model.py b/odoo/addons/base/models/ir_model.py
index aa30446d240..88795c19564 100644
--- a/odoo/addons/base/models/ir_model.py
+++ b/odoo/addons/base/models/ir_model.py
@@ -768,6 +768,7 @@ class IrModelFields(models.Model):
'index': bool(field.index),
'store': bool(field.store),
'copy': bool(field.copy),
+ 'on_delete': getattr(field, 'ondelete', None),
'related': ".".join(field.related) if field.related else None,
'readonly': bool(field.readonly),
'required': bool(field.required),
diff --git a/odoo/service/server.py b/odoo/service/server.py
index 4820b1e3257..034409b7c32 100644
--- a/odoo/service/server.py
+++ b/odoo/service/server.py
@@ -135,6 +135,8 @@ class FSWatcher(object):
try:
source = open(path, 'rb').read() + b'\n'
compile(source, path, 'exec')
+ except FileNotFoundError:
+ _logger.error('autoreload: python code change detected, FileNotFound for %s', path)
except SyntaxError:
_logger.error('autoreload: python code change detected, SyntaxError in %s', path)
else: