-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: 16.0
Are you sure you want to change the base?
Conversation
<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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)]
)
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
5027