Add support for datetime_field to Many2One, Reference

issue4579
review30671002
This commit is contained in:
Jan Grasnick
2016-10-26 09:37:06 +02:00
parent e814e196d8
commit 7c3f2a2072
2 changed files with 19 additions and 0 deletions
+1
View File
@@ -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
+18
View File
@@ -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];
},