summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-01-18 16:21:55 +0100
committerChristophe Simonis <chs@odoo.com>2017-01-18 16:21:55 +0100
commitf0a5618e6101741d6417aa7fa6c7e596210e142e (patch)
tree3e5e17e0d1a79268eb54eb51afb02fea49929d35
parentf932f4d4f4730936931dbb8cf49868a25b05640b (diff)
parent6169018c33705d2c591c402761e5f9ac9b36ce55 (diff)
[MERGE] forward port branch saas-11 up to 6169018c337
-rw-r--r--addons/calendar/security/calendar_security.xml10
-rw-r--r--addons/web/static/src/js/views/list_view.js18
-rw-r--r--doc/cla/individual/dansanti.md9
-rw-r--r--odoo/addons/test_new_api/tests/test_onchange.py7
-rw-r--r--odoo/fields.py5
5 files changed, 34 insertions, 15 deletions
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 @@
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
</record>
+ <record id="calendar_event_rule_private" model="ir.rule">
+ <field ref="model_calendar_event" name="model_id"/>
+ <field name="name">Private events</field>
+ <field name="domain_force">['|', ('class', '!=', 'private'), '&amp;', ('class', '=', 'private'), ('partner_ids', 'in', user.partner_id.id)]</field>
+ <field name="perm_read" eval="False"/>
+ <field name="perm_write" eval="True"/>
+ <field name="perm_create" eval="True"/>
+ <field name="perm_unlink" eval="True"/>
+ </record>
+
</data>
</odoo>
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):