[MERGE] forward port of branch 7.0 up to 2a0c018
This commit is contained in:
commit
ce690649e9
|
@ -306,7 +306,8 @@ class account_move_line(osv.osv):
|
||||||
if not id:
|
if not id:
|
||||||
return []
|
return []
|
||||||
ml = self.browse(cr, uid, id, context=context)
|
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):
|
def _balance(self, cr, uid, ids, name, arg, context=None):
|
||||||
if context is 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))])
|
visible_parent_ids = self.pool.get('document.directory').search(cr, uid, [('id', 'in', list(parent_ids))])
|
||||||
|
|
||||||
# null parents means allowed
|
# null parents means allowed
|
||||||
|
orig_ids = ids # save the ids, to keep order
|
||||||
ids = parents.get(None,[])
|
ids = parents.get(None,[])
|
||||||
for parent_id in visible_parent_ids:
|
for parent_id in visible_parent_ids:
|
||||||
ids.extend(parents[parent_id])
|
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
|
return len(ids) if count else ids
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context=None):
|
def copy(self, cr, uid, id, default=None, context=None):
|
||||||
|
|
|
@ -433,7 +433,8 @@
|
||||||
var self = this;
|
var self = this;
|
||||||
var on_write_callback = self.fields_view.arch.attrs.on_write;
|
var on_write_callback = self.fields_view.arch.attrs.on_write;
|
||||||
if (!on_write_callback) { return $.when(); }
|
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) {
|
.then(function (ids) {
|
||||||
return $.when.apply(
|
return $.when.apply(
|
||||||
null, _(ids).map(
|
null, _(ids).map(
|
||||||
|
|
|
@ -726,12 +726,12 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
|
||||||
},
|
},
|
||||||
do_show_more: function(evt) {
|
do_show_more: function(evt) {
|
||||||
var self = this;
|
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']), {
|
return this.dataset.read_slice(this.view.fields_keys.concat(['__last_update']), {
|
||||||
'limit': self.view.limit,
|
'limit': self.view.limit,
|
||||||
'offset': self.dataset_offset += self.view.limit
|
'offset': self.dataset_offset += self.view.limit
|
||||||
}).then(function(records) {
|
}).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.do_add_records(records);
|
||||||
self.compute_cards_auto_height();
|
self.compute_cards_auto_height();
|
||||||
self.view.postprocess_m2m_tags();
|
self.view.postprocess_m2m_tags();
|
||||||
|
|
|
@ -44,10 +44,11 @@ class ir_filters(osv.osv):
|
||||||
``context`` of the matching ``ir.filters``.
|
``context`` of the matching ``ir.filters``.
|
||||||
"""
|
"""
|
||||||
# available filters: private filters (user_id=uid) and public filters (uid=NULL)
|
# 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,
|
filter_ids = self.search(cr, uid,
|
||||||
[('model_id','=',model),('user_id','in',[uid, False])])
|
[('model_id','=',model),('user_id','in',[uid, False])])
|
||||||
my_filters = self.read(cr, uid, filter_ids,
|
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
|
return my_filters
|
||||||
|
|
||||||
def _check_global_default(self, cr, uid, vals, matching_filters, context=None):
|
def _check_global_default(self, cr, uid, vals, matching_filters, context=None):
|
||||||
|
|
Loading…
Reference in New Issue