Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5027][ADD] partner_search_alias #28

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

kanda999
Copy link

Comment on lines 3 to 15
<record id="view_res_partner_filter" model="ir.ui.view">
<field name="name">res.partner.select</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<field name="name" position="attributes">
<!-- add search_alias to name search -->
<attribute
name="filter_domain"
>['|', '|', '|', '|', '|', ('display_name', 'ilike', self), ('ref', '=', self), ('email', 'ilike', self), ('vat', 'ilike', self), ('company_registry', 'ilike', self), ('search_alias', 'ilike', self)]</attribute>
</field>
</field>
</record>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to consider the approach of extending the get_view() method instead, in a similar manner as https://github.com/oca/sale-workflow/blob/3625fea/sale_partner_selectable_option/models/sale_order.py#L12-L24. That way we should be able to avoid the risk of conflicts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this approach can lead to unintended behavior if there are some modules that add new domain at the first place of domain lists (eg, [('new_field', '=', 'value'), '|', '|', '|', '|', ('display_name', 'ilike', self), ('ref', '=', self), ('email', 'ilike', self), ('vat', 'ilike', self), ('company_registry', 'ilike', self)])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that be cleared by using expression.OR()?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider there will be only OR concatenations for domain of name search? If so, yes.
In my opinion, I consider there is rare chance of using AND concatenation for name search domain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AungKoKoLin1997 I can't imagine a case where AND is suitable for the name search. Besides, I don't see the downside of using expression.OR() compared to the domain override if that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants