[MERGE] forward port of branch saas-3 up to ce69064
This commit is contained in:
commit
d780014248
|
@ -305,7 +305,8 @@ class account_move_line(osv.osv):
|
|||
if not id:
|
||||
return []
|
||||
ml = self.browse(cr, uid, id, context=context)
|
||||
return map(lambda x: x.id, ml.move_id.line_id)
|
||||
domain = (context or {}).get('on_write_domain', [])
|
||||
return self.pool.get('account.move.line').search(cr, uid, domain + [['id', 'in', [l.id for l in ml.move_id.line_id]]], context=context)
|
||||
|
||||
def _balance(self, cr, uid, ids, name, arg, context=None):
|
||||
if context is None:
|
||||
|
|
|
@ -103,10 +103,13 @@ class document_file(osv.osv):
|
|||
visible_parent_ids = self.pool.get('document.directory').search(cr, uid, [('id', 'in', list(parent_ids))])
|
||||
|
||||
# null parents means allowed
|
||||
orig_ids = ids # save the ids, to keep order
|
||||
ids = parents.get(None,[])
|
||||
for parent_id in visible_parent_ids:
|
||||
ids.extend(parents[parent_id])
|
||||
|
||||
# sort result according to the original sort ordering
|
||||
ids = [id for id in orig_ids if id in ids]
|
||||
return len(ids) if count else ids
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
|
|
|
@ -433,7 +433,8 @@
|
|||
var self = this;
|
||||
var on_write_callback = self.fields_view.arch.attrs.on_write;
|
||||
if (!on_write_callback) { return $.when(); }
|
||||
return this.dataset.call(on_write_callback, [source_record.get('id')])
|
||||
var context = new instance.web.CompoundContext(self.dataset.get_context(), {'on_write_domain': self.dataset.domain}).eval();
|
||||
return this.dataset.call(on_write_callback, [source_record.get('id'), context])
|
||||
.then(function (ids) {
|
||||
return $.when.apply(
|
||||
null, _(ids).map(
|
||||
|
|
|
@ -739,12 +739,12 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
|
|||
},
|
||||
do_show_more: function(evt) {
|
||||
var self = this;
|
||||
var ids = self.view.dataset.ids.splice(0);
|
||||
var ids = self.view.dataset.ids.slice(0);
|
||||
return this.dataset.read_slice(this.view.fields_keys.concat(['__last_update']), {
|
||||
'limit': self.view.limit,
|
||||
'offset': self.dataset_offset += self.view.limit
|
||||
}).then(function(records) {
|
||||
self.view.dataset.ids = ids.concat(self.dataset.ids);
|
||||
self.view.dataset.ids = ids.concat(_.difference(self.dataset.ids, ids));
|
||||
self.do_add_records(records);
|
||||
self.compute_cards_auto_height();
|
||||
self.view.postprocess_m2m_tags();
|
||||
|
|
|
@ -58,11 +58,12 @@ class ir_filters(osv.osv):
|
|||
"""
|
||||
# available filters: private filters (user_id=uid) and public filters (uid=NULL),
|
||||
# and filters for the action (action_id=action_id) or global (action_id=NULL)
|
||||
context = self.pool['res.users'].context_get(cr, uid)
|
||||
action_domain = self._get_action_domain(cr, uid, action_id)
|
||||
filter_ids = self.search(cr, uid, action_domain +
|
||||
[('model_id','=',model),('user_id','in',[uid, False])])
|
||||
my_filters = self.read(cr, uid, filter_ids,
|
||||
['name', 'is_default', 'domain', 'context', 'user_id'])
|
||||
['name', 'is_default', 'domain', 'context', 'user_id'], context=context)
|
||||
return my_filters
|
||||
|
||||
def _check_global_default(self, cr, uid, vals, matching_filters, context=None):
|
||||
|
|
Loading…
Reference in New Issue