[MERGE] forward port branch 10.0 up to 65ad60665e

This commit is contained in:
Christophe Simonis
2018-07-31 17:03:04 +02:00
5 changed files with 31 additions and 4 deletions
@@ -280,7 +280,7 @@ var Feedback = Widget.extend({
// only display textearea if bad smiley selected
var close_chat = false;
if (this.rating === 0) {
if (this.rating === 1) {
this.$('.o_livechat_rating_reason').show();
} else {
this.$('.o_livechat_rating_reason').hide();
+2 -2
View File
@@ -239,8 +239,8 @@ class Website(models.Model):
if not pricelists: # no pricelist for this country, or no GeoIP
pricelists |= all_pl.filtered(lambda pl: not show_visible or pl.selectable or pl.id in (current_pl, order_pl))
else:
pricelists |= all_pl.filtered(lambda pl: not show_visible and pl.sudo().code)
if not show_visible and not country_code:
pricelists |= all_pl.filtered(lambda pl: pl.sudo().code)
# This method is cached, must not return records! See also #8795
return pricelists.ids
+1 -1
View File
@@ -684,7 +684,7 @@ class UsersImplied(models.Model):
for user in self.with_context({}):
gs = set(concat(g.trans_implied_ids for g in user.groups_id))
vals = {'groups_id': [(4, g.id) for g in gs]}
super(UsersImplied, self).write(vals)
super(UsersImplied, user).write(vals)
return res
#
+1
View File
@@ -31,3 +31,4 @@ import test_view_validation
import test_views
import test_xmlrpc
import test_res_partner_bank
import test_non_regression
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
"""
Non-Regression Tests
"""
from openerp.tests.common import TransactionCase
class TestNR(TransactionCase):
def test_issue26036(self):
U = self.env["res.users"]
G = self.env["res.groups"]
group_A = G.create({"name": "A"})
group_AA = G.create({"name": "AA", "implied_ids": [(6, 0, [group_A.id])]})
group_B = G.create({"name": "B"})
group_BB = G.create({"name": "BB", "implied_ids": [(6, 0, [group_B.id])]})
group_C = G.create({"name": "C"})
user_a = U.create({"name": "a", "login": "a", "groups_id": [(6, 0, [group_AA.id])]})
user_b = U.create({"name": "b", "login": "b", "groups_id": [(6, 0, [group_BB.id])]})
(user_a + user_b).write({"groups_id": [(4, group_C.id)]})
self.assertEqual(user_a.groups_id, (group_AA + group_A + group_C))
self.assertEqual(user_b.groups_id, (group_BB + group_B + group_C))