[MERGE] forward port of branch 7.0 up to 2a0c018

This commit is contained in:
Christophe Simonis 2015-03-26 17:56:05 +01:00
commit ce690649e9
5 changed files with 11 additions and 5 deletions

View File

@ -306,7 +306,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:

View File

@ -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):

View File

@ -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(

View File

@ -726,12 +726,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();

View File

@ -44,10 +44,11 @@ class ir_filters(osv.osv):
``context`` of the matching ``ir.filters``.
"""
# available filters: private filters (user_id=uid) and public filters (uid=NULL)
context = self.pool['res.users'].context_get(cr, uid)
filter_ids = self.search(cr, uid,
[('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):