[FIX] web: prevent record creation in M2O with option {'no_create': True}
before this fix, if you enter a random string and exit focus you'll be prompted to create it.
This commit is contained in:
committed by
Géry Debongnie
parent
76e6a0e356
commit
9da93dc232
@@ -557,6 +557,27 @@ QUnit.module('relational_fields', {
|
||||
form.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('no_create option on a many2one', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var form = createView({
|
||||
View: FormView,
|
||||
model: 'partner',
|
||||
data: this.data,
|
||||
arch: '<form string="Partners">' +
|
||||
'<sheet>' +
|
||||
'<field name="product_id" options="{\'no_create\': True}"/>' +
|
||||
'</sheet>' +
|
||||
'</form>',
|
||||
});
|
||||
|
||||
form.$('.o_form_field_many2one input').focus();
|
||||
form.$('.o_form_field_many2one input').val('new partner').trigger('keyup').trigger('focusout');
|
||||
|
||||
assert.strictEqual($('.modal').length, 0, "should not display the create modal");
|
||||
form.destroy();
|
||||
});
|
||||
|
||||
QUnit.module('FieldOne2Many');
|
||||
|
||||
QUnit.test('one2many basic properties', function (assert) {
|
||||
|
||||
Reference in New Issue
Block a user