Commit 9904fbbe by François C.

Merge branch '6190-fix-add-social-parts' into 'dev_cooperatic'

don't fetch associated people for envelops members search

See merge request !272
parents 66e8a55a 9adac638
Pipeline #3448 failed with stage
in 1 minute 6 seconds
...@@ -226,7 +226,7 @@ function set_envelop_dom(envelop, envelop_name, envelop_content_id, envelop_inde ...@@ -226,7 +226,7 @@ function set_envelop_dom(envelop, envelop_name, envelop_content_id, envelop_inde
let search_str = modal.find('.search_member_input').val(); let search_str = modal.find('.search_member_input').val();
$.ajax({ $.ajax({
url: '/members/search/' + search_str + "?search_type=short", url: '/members/search/' + search_str + "?search_type=envelops",
dataType : 'json', dataType : 'json',
success: function(data) { success: function(data) {
members_search_results = data.res; members_search_results = data.res;
......
...@@ -808,12 +808,14 @@ class CagetteMember(models.Model): ...@@ -808,12 +808,14 @@ 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': if search_type != 'members' and search_type != 'envelops':
cond.append(['is_associated_people', '=', True]) cond.append(['is_associated_people', '=', True])
else: else:
cond.append(['is_associated_people', '=', False]) cond.append(['is_associated_people', '=', False])
if search_type != 'envelops':
cond.append(['cooperative_state', '!=', 'associated']) cond.append(['cooperative_state', '!=', 'associated'])
# cond.append(['cooperative_state', '!=', 'unsubscribed']) # cond.append(['cooperative_state', '!=', 'unsubscribed'])
if search_type == "full" or search_type == 'members' or search_type == "manage_shift_registrations": if search_type == "full" or search_type == 'members' or search_type == "manage_shift_registrations":
fields = CagetteMember.m_default_fields fields = CagetteMember.m_default_fields
if not shift_id is None: if not shift_id is None:
...@@ -881,9 +883,9 @@ class CagetteMember(models.Model): ...@@ -881,9 +883,9 @@ class CagetteMember(models.Model):
return res return res
else: else:
# TODO differentiate short & subscription_data searches # TODO differentiate envelops & subscription_data searches
fields = CagetteMember.m_short_default_fields fields = CagetteMember.m_short_default_fields
fields = fields + ['total_partner_owned_share','amount_subscription'] fields = fields + ['total_partner_owned_share', 'amount_subscription']
res = api.search_read('res.partner', cond, fields) res = api.search_read('res.partner', cond, fields)
return res return res
......
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