From 5b4d303d05a95eae7cc52f66386c9bc7a45518f1 Mon Sep 17 00:00:00 2001 From: Denis Leemann Date: Fri, 29 Jan 2016 14:11:04 +0100 Subject: [PATCH 1/2] [FIX] kanban: 180 in Firefox 43+ and Chrome 48+ The kanban CSS applies both a 90 degree rotation and a top-bottom rtl writing mode to folded kanban group titles. This was initially fine because browsers didn't support the (SVG) "tb-rl" value for writing-mode and the property was thus ignored. Firefox 43 (December 2015) and Chrome 48 (January 2016) added support for this value, and thus now end up with a 180 degree rotation on the title. Issue #7955 fixed it in 8.0 due to MSIE impact, this is essentially a backport to 7.0. close #10687 --- addons/web_kanban/static/src/css/kanban.css | 2 -- addons/web_kanban/static/src/css/kanban.sass | 2 -- 2 files changed, 4 deletions(-) diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index 4af2eacb5d6..b2b44996803 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -162,7 +162,6 @@ color: #666666; } .openerp .oe_kanban_view .oe_kanban_group_title_vertical { - writing-mode: tb-rl; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); @@ -667,7 +666,6 @@ display: inline-block !important; } .openerp_ie .oe_kanban_view .oe_kanban_group_title_vertical { - -ms-writing-mode: lr-tb !important; background: #f0eeee; } .openerp_ie .oe_kanban_view.oe_kanban_grouped .oe_kanban_group_header { diff --git a/addons/web_kanban/static/src/css/kanban.sass b/addons/web_kanban/static/src/css/kanban.sass index 571033bfd45..4dbf26d0972 100644 --- a/addons/web_kanban/static/src/css/kanban.sass +++ b/addons/web_kanban/static/src/css/kanban.sass @@ -178,7 +178,6 @@ .oe_kanban_group_title_undefined color: #666666 .oe_kanban_group_title_vertical - writing-mode: tb-rl -webkit-transform: rotate(90deg) -moz-transform: rotate(90deg) -o-transform: rotate(90deg) @@ -552,7 +551,6 @@ .oe_kanban_group_header.oe_kanban_group_folded .oe_kanban_group_title_vertical display: inline-block !important .oe_kanban_group_title_vertical - -ms-writing-mode: lr-tb !important background: rgb(240, 238, 238) &.oe_kanban_grouped .oe_kanban_group_header From 4de3f4c4baa45b6bc5d0d2ede158d29ca4f99d57 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 12 Jan 2016 17:58:14 +0100 Subject: [PATCH 2/2] [FIX] expression: fix search for o2m with non existing id The result of searching on a o2m field for a missing ID was the whole set of records which do not have any lines in the o2m fields. This is definitely not the desired behavior, and could lead to disatrous performance, because the returned set could be extremely large. One example of such behavior is for recomputing fields in the env cache in 8.0+. When a o2m line gets deleted, it triggers the recompute of any dependent fields. In order to locate the records to recompute, the ORM searches for the 'parent' records in the comodel table. When this operation is done by 2 users concurrently the o2m line may not exist anymore, and the bug is triggered: dependent fields are recomputed on a possibly very large set of records that did not need any recompute! --- openerp/addons/base/test/test_osv_expression.yml | 8 ++++++++ openerp/osv/expression.py | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/openerp/addons/base/test/test_osv_expression.yml b/openerp/addons/base/test/test_osv_expression.yml index e0061135d85..7edea16d7d8 100644 --- a/openerp/addons/base/test/test_osv_expression.yml +++ b/openerp/addons/base/test/test_osv_expression.yml @@ -423,11 +423,19 @@ u1b = res_users.create(cr, uid, {'login': 'dbo2', 'partner_id': p1}) u2 = res_users.create(cr, uid, {'login': 'rpo', 'partner_id': p2}) assert [p1] == res_partner.search(cr, uid, [('user_ids', 'in', u1a)]), "o2m IN accept single int on right side" + assert [p1] == res_partner.search(cr, uid, [('user_ids', '=', 'Dédé Boitaclou')]), "o2m NOT IN matches none on the right side" + assert [] == res_partner.search(cr, uid, [('user_ids', 'in', [10000])]), "o2m NOT IN matches none on the right side" assert [p1,p2] == res_partner.search(cr, uid, [('user_ids', 'in', [u1a,u2])]), "o2m IN matches any on the right side" all_partners = res_partner.search(cr, uid, []) assert (set(all_partners) - set([p1])) == set(res_partner.search(cr, uid, [('user_ids', 'not in', u1a)])), "o2m NOT IN matches none on the right side" + # For 8.0: assert (set(all_partners) - set([p1])) == set(res_partner.search(cr, uid, [('user_ids', '!=', 'Dédé Boitaclou')])), "o2m NOT IN matches none on the right side" assert (set(all_partners) - set([p1,p2])) == set(res_partner.search(cr, uid, [('user_ids', 'not in', [u1b, u2])])), "o2m NOT IN matches none on the right side" + + + + + # child_of x returns x and its children (direct or not). company = self.browse(cr, uid, ref('ymltest_company3')) expected = [ref('ymltest_company3'), ref('ymltest_company4')] diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index 722937fb438..5fcba0b8217 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -930,6 +930,10 @@ class expression(object): call_null = False o2m_op = 'not in' if operator in NEGATIVE_TERM_OPERATORS else 'in' push(create_substitution_leaf(leaf, ('id', o2m_op, ids2), working_model)) + elif operator in ('like', 'ilike', 'in', '='): + # no match found with positive search operator => no result (FALSE_LEAF) + call_null = False + push(create_substitution_leaf(leaf, FALSE_LEAF, working_model)) if call_null: o2m_op = 'in' if operator in NEGATIVE_TERM_OPERATORS else 'not in'