[FIX] web: display_name in analytical tag not displayed

Steps to reproduce:
- Install accounting
- Create more than 6 analytical tags
- Create an invoice
- Create a payment
- Go in Accounting>Actions>Reconciliation, tab Manal Operations
- In the field Analytical Tag, click on 'Search More' and selected 1 or multiple tags

Issue:
Void tags are displayed

Solution:
Fetch the field `display_name`

ref commit: 84f0644802865c6454014059842eb6a9d4fd40e4
opw-2734029

closes odoo/odoo#87311

X-original-commit: 936bad32cf1024570da4880ccc5375b02b30c1c2
Related: odoo/enterprise#25631
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Yolann Sabaux
2022-03-28 10:46:28 +02:00
parent 1266b7f470
commit dd239a604a
3 changed files with 77 additions and 4 deletions
@@ -589,7 +589,7 @@ QUnit.module('Views', {
});
QUnit.test('SelectCreateDialog calls on_selected with every record matching the domain', async function (assert) {
assert.expect(1);
assert.expect(3);
const parent = await createParent({
data: this.data,
@@ -610,7 +610,9 @@ QUnit.module('Views', {
new dialogs.SelectCreateDialog(parent, {
res_model: 'partner',
on_selected: function(records) {
assert.equal(records.length, 3)
assert.equal(records.length, 3);
assert.strictEqual(records.map((r) => r.display_name).toString(), "blipblip,macgyver,Jack O'Neill");
assert.strictEqual(records.map((r) => r.id).toString(), "1,2,3");
}
}).open();
await testUtils.nextTick();
@@ -622,6 +624,42 @@ QUnit.module('Views', {
parent.destroy();
});
QUnit.test('SelectCreateDialog calls on_selected with every record matching without selecting a domain', async function (assert) {
assert.expect(3);
const parent = await createParent({
data: this.data,
archs: {
'partner,false,list':
'<tree limit="2" string="Partner">' +
'<field name="display_name"/>' +
'<field name="foo"/>' +
'</tree>',
'partner,false,search':
'<search>' +
'<field name="foo"/>' +
'</search>',
},
session: {},
});
new dialogs.SelectCreateDialog(parent, {
res_model: 'partner',
on_selected: function(records) {
assert.equal(records.length, 2);
assert.strictEqual(records.map((r) => r.display_name).toString(), "blipblip,macgyver");
assert.strictEqual(records.map((r) => r.id).toString(), "1,2");
}
}).open();
await testUtils.nextTick();
await testUtils.dom.click($('thead .o_list_record_selector input'));
await testUtils.dom.click($('.o_list_selection_box '));
await testUtils.dom.click($('.modal .o_select_button'));
parent.destroy();
});
QUnit.test('propagate can_create onto the search popup o2m', async function (assert) {
assert.expect(4);