Commit 6aa05fdd by Damien Moulard

Merge branch '2459-search-associate-only-in-members' into 'dev_cooperatic'

2459-search-associate-only-in-members

See merge request !138
parents 5bc06b9f dca25d09
Pipeline #1914 passed with stage
in 1 minute 27 seconds
...@@ -775,9 +775,12 @@ class CagetteMember(models.Model): ...@@ -775,9 +775,12 @@ class CagetteMember(models.Model):
cond = [['name', 'ilike', str(key)]] cond = [['name', 'ilike', str(key)]]
cond.append('|') cond.append('|')
cond.append(['is_member', '=', True]) cond.append(['is_member', '=', True])
if search_type != 'members':
cond.append(['is_associated_people', '=', True]) cond.append(['is_associated_people', '=', True])
else:
cond.append(['is_associated_people', '=', False])
# cond.append(['cooperative_state', '!=', 'unsubscribed']) # cond.append(['cooperative_state', '!=', 'unsubscribed'])
if search_type == "full": if search_type == "full" or search_type == 'members':
fields = CagetteMember.m_default_fields fields = CagetteMember.m_default_fields
if not shift_id is None: if not shift_id is None:
CagetteMember.m_default_fields.append('tmpl_reg_line_ids') CagetteMember.m_default_fields.append('tmpl_reg_line_ids')
......
...@@ -689,7 +689,7 @@ $(document).ready(function() { ...@@ -689,7 +689,7 @@ $(document).ready(function() {
if (search_str) { if (search_str) {
$.ajax({ $.ajax({
url: '/members/search/' + search_str, url: '/members/search/' + search_str+ "?search_type=members",
dataType : 'json', dataType : 'json',
success: function(data) { success: function(data) {
members_search_results = []; members_search_results = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment