diff --git a/CHANGELOG b/CHANGELOG index 139fa3dc51..00fb044aaf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add support for datetime_field to Many2One, Reference * Add calendar view * Move info-bar to the top * Add noeval to PYSONDecoder diff --git a/src/model.js b/src/model.js index ccaa3a4376..7cd6929cb6 100644 --- a/src/model.js +++ b/src/model.js @@ -1783,6 +1783,15 @@ Sao.field.Many2One._super.set_client.call(this, record, value, force_change); }, + get_context: function(record) { + var context = Sao.field.Many2One._super.get_context.call( + this, record); + if (this.description.datetime_field) { + context._datetime = record.get_eval()[ + this.description.datetime_field]; + } + return context; + }, validation_domains: function(record, pre_validate) { return this.get_domains(record, pre_validate)[0]; }, @@ -2297,6 +2306,15 @@ return Sao.field.Reference._super.get_on_change_value.call( this, record); }, + get_context: function(record) { + var context = Sao.field.Reference._super.get_context.call( + this, record); + if (this.description.datetime_field) { + context._datetime = record.get_eval()[ + this.description.datetime_field]; + } + return context; + }, validation_domains: function(record, pre_validate) { return this.get_domains(record, pre_validate)[0]; },