[IMP] partner_profiles: filter public profiles in name_search answer
This commit is contained in:
committed by
Stéphan Sainléger
parent
2162312fb1
commit
6e227a83d4
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "partner_profiles",
|
||||
"version": "12.0.1.0.5",
|
||||
"version": "12.0.1.1.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Stéphan Sainléger",
|
||||
@@ -27,7 +27,6 @@
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
"views/res_partner_view.xml",
|
||||
"views/calendar_event_view.xml",
|
||||
"views/partner_profile_view.xml",
|
||||
"data/partner_profile_data.xml",
|
||||
"data/res_partner_data.xml",
|
||||
|
@@ -189,6 +189,15 @@ class res_partner(models.Model):
|
||||
when a partner is attached to him. """
|
||||
return ['title']
|
||||
|
||||
@api.model
|
||||
def name_search(self, name='', args=None, operator='ilike', limit=100):
|
||||
""" Remove public profile partners from the name_search results"""
|
||||
if not args:
|
||||
args = [("is_public_profile", "=", False)]
|
||||
else:
|
||||
args.append(("is_public_profile", "=", False))
|
||||
return super(res_partner, self).name_search(name, args, operator, limit)
|
||||
|
||||
##################################################################################
|
||||
## Planned actions
|
||||
##################################################################################
|
||||
|
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="partner_profiles_calendar_event_form_view" model="ir.ui.view">
|
||||
<field name="name">partner.profiles.calendar.event.view</field>
|
||||
<field name="model">calendar.event</field>
|
||||
<field name="inherit_id" ref="calendar.view_calendar_event_form" />
|
||||
<field name="sequence">99</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_ids" position="attributes">
|
||||
<attribute name="domain">[('is_public_profile', '=', False)]</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
Reference in New Issue
Block a user