Skip to content

Commit

Permalink
[CHG] from now a distribution list without an included filter returns…
Browse files Browse the repository at this point in the history
… nothing
  • Loading branch information
Cedric-Pigeon committed Sep 7, 2015
1 parent a180e7c commit 212a774
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions distribution_list/distribution_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def _order_del(self, cr, uid, lst, context=None):
res_lst.append(el)
return res_lst

def _get_ids_if_no_included_filter(self, cr, uid, ids, context=None):
return []

_columns = {
'id': fields.integer('ID'),
'name': fields.char(string='Name', required=True),
Expand Down Expand Up @@ -191,10 +194,10 @@ def get_ids_from_distribution_list(self, cr, uid, ids, safe_mode=True,

if not distribution_list.to_include_distribution_list_line_ids:
# without included filters get all ids
# from the destination model
# from a method to override
model = distribution_list.dst_model_id.model
result = self.pool.get(model).search(cr, uid, [],
context=context)
result = self._get_ids_if_no_included_filter(
cr, uid, distribution_list.id, context)
lst = l_to_include.setdefault(model, [])
lst += result
bridge_field = DEFAULT_BRIDGE_FIELD
Expand Down Expand Up @@ -414,6 +417,7 @@ def _get_record(self, record_or_list):
self.pool.get('res.company')._company_default_get(
cr, uid, 'distribution.list.line', context=c),
'domain': "[]",

'src_model_id': lambda self, cr, uid, c:
self.pool.get('ir.model').search(
cr, uid, [('model', '=', 'res.partner')], limit=1, context=c)[0],
Expand Down

0 comments on commit 212a774

Please sign in to comment.