diff --git a/addons/calendar/security/calendar_security.xml b/addons/calendar/security/calendar_security.xml index e448e61a075..197a41b8c67 100644 --- a/addons/calendar/security/calendar_security.xml +++ b/addons/calendar/security/calendar_security.xml @@ -23,5 +23,15 @@ + + + Private events + ['|', ('class', '!=', 'private'), '&', ('class', '=', 'private'), ('partner_ids', 'in', user.partner_id.id)] + + + + + + diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js index d97e6a2de11..4b5ea961589 100644 --- a/addons/web/static/src/js/views/list_view.js +++ b/addons/web/static/src/js/views/list_view.js @@ -1493,20 +1493,16 @@ ListView.Groups = Class.extend({ }); }, setup_resequence_rows: function (list, dataset) { + var sequence_field = _(this.columns).findWhere({'widget': 'handle'}); + var seqname = sequence_field ? sequence_field.name : 'sequence'; + // drag and drop enabled if list is not sorted (unless it is sorted by - // sequence (ASC)), and there is a visible column with @widget=handle - // or "sequence" column in the view. - if ((dataset.sort && dataset.sort() && dataset.sort() !== 'sequence' - && dataset.sort() !== 'sequence ASC') - || !_(this.columns).any(function (column) { - return column.widget === 'handle' - || column.name === 'sequence'; })) { + // its sequence field (ASC)), and there is a visible column with + // @widget=handle or "sequence" column in the view. + if ((dataset.sort && [seqname, seqname + 'ASC', ''].indexOf(dataset.sort()) === -1) + || !_(this.columns).findWhere({'name': seqname})) { return; } - var sequence_field = _(this.columns).find(function (c) { - return c.widget === 'handle'; - }); - var seqname = sequence_field ? sequence_field.name : 'sequence'; // ondrop, move relevant record & fix sequences list.$current.sortable({ diff --git a/doc/cla/individual/dansanti.md b/doc/cla/individual/dansanti.md new file mode 100644 index 00000000000..a13d64b6e27 --- /dev/null +++ b/doc/cla/individual/dansanti.md @@ -0,0 +1,9 @@ +Chile, 2016-05-31 + +I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this declaration. + +Signed, + +Daniel Santibáñez Polanco dansanti@gmail.com https://github.com/dansanti \ No newline at end of file diff --git a/odoo/addons/test_new_api/tests/test_onchange.py b/odoo/addons/test_new_api/tests/test_onchange.py index a6e2bff1b35..0301ca2b3e4 100644 --- a/odoo/addons/test_new_api/tests/test_onchange.py +++ b/odoo/addons/test_new_api/tests/test_onchange.py @@ -307,7 +307,12 @@ class TestOnChange(common.TransactionCase): # When one2many domain contains non-computed field, things are ok self.assertEqual(result['value']['important_messages'], - [(5,)] + [(4, msg.id) for msg in discussion.important_messages]) + [(5,)] + [(1, msg.id, { + 'name': msg.name, + 'body': msg.body, + 'author': (msg.author.id, msg.author.display_name), + 'size': msg.size + }) for msg in discussion.important_messages]) # But here with commit 5676d81, we get value of: [(2, email.id)] self.assertEqual( diff --git a/odoo/fields.py b/odoo/fields.py index 52edc8e4538..9f6e03e8495 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -2132,9 +2132,8 @@ class One2many(_RelationalMulti): _description_relation_field = property(attrgetter('inverse_name')) def convert_to_onchange(self, value, record, fnames=()): - if fnames: - # do not serialize self's inverse field - fnames = [name for name in fnames if name != self.inverse_name] + fnames = set(fnames or value.fields_view_get()['fields']) + fnames.discard(self.inverse_name) return super(One2many, self).convert_to_onchange(value, record, fnames) def check_schema(self, model):