[FIX] web: FieldDomain: open selection with field context

Closes #33658

closes odoo/odoo#34989

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
This commit is contained in:
Aaron Bohy
2019-07-19 12:23:10 +00:00
parent 3295ffe632
commit c1eec46f7e
3 changed files with 32 additions and 1 deletions
@@ -5743,6 +5743,36 @@ QUnit.module('basic_fields', {
form.destroy();
});
QUnit.test('field context is propagated when opening selection', async function (assert) {
assert.expect(1);
this.data.partner.records[0].foo = "[]";
var form = await createView({
View: FormView,
model: 'partner',
data: this.data,
arch: `
<form>
<field name="foo" widget="domain" options="{'model': 'partner_type'}" context="{'tree_view_ref': 3}"/>
</form>
`,
archs: {
'partner_type,false,list': '<tree><field name="display_name"/></tree>',
'partner_type,3,list': '<tree><field name="id"/></tree>',
'partner_type,false,search': '<search><field name="name" string="Name"/></search>',
},
res_id: 1,
});
await testUtils.dom.click(form.$(".o_domain_show_selection_button"));
assert.strictEqual($('.modal .o_data_row').text(), '1214',
"should have picked the correct list view");
form.destroy();
});
QUnit.module('FieldProgressBar');
QUnit.test('Field ProgressBar: max_value should update', async function (assert) {