[FIX] web: various fixes for date and datetime in client
The field_utils date method have been modified recently, and the idea behind those changes is that the BasicModel keeps at all time a moment instance as its internal representation of a date or datetime. But the parse and format methods did not properly support unset dates, so we have to slighlty change them to support the case where their values is not set.
This commit is contained in:
committed by
Aaron Bohy
parent
4a612171b3
commit
da4e653695
@@ -479,6 +479,22 @@ QUnit.module('basic_fields', {
|
||||
|
||||
QUnit.module('FieldDate');
|
||||
|
||||
QUnit.test('date field is empty if no date is set', function (assert) {
|
||||
assert.expect(2);
|
||||
|
||||
var form = createView({
|
||||
View: FormView,
|
||||
model: 'partner',
|
||||
data: this.data,
|
||||
arch:'<form string="Partners"><field name="date"/></form>',
|
||||
res_id: 4,
|
||||
});
|
||||
var $span = form.$('span.o_form_field');
|
||||
assert.strictEqual($span.length, 1, "should have one span in the form view");
|
||||
assert.strictEqual($span.text(), "", "and it should be empty");
|
||||
|
||||
});
|
||||
|
||||
QUnit.test('date field in edit mode', function (assert) {
|
||||
assert.expect(7);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user