bugfix for active=false search
authorhda@tinyerp.com <>
Mon, 10 Nov 2008 11:07:21 +0000 (16:37 +0530)
committerhda@tinyerp.com <>
Mon, 10 Nov 2008 11:07:21 +0000 (16:37 +0530)
bzr revid: hda@tinyerp.com-20081110110721-t55bijn008yq4z7b

1  2 
bin/osv/orm.py

diff --cc bin/osv/orm.py
@@@ -1,24 -1,31 +1,24 @@@
  # -*- encoding: utf-8 -*-
  ##############################################################################
  #
- #    OpenERP, Open Source Management Solution 
 -# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
++#    OpenERP, Open Source Management Solution
 +#    Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
 +#    $Id$
  #
 -# $Id$
 +#    This program is free software: you can redistribute it and/or modify
 +#    it under the terms of the GNU General Public License as published by
 +#    the Free Software Foundation, either version 3 of the License, or
 +#    (at your option) any later version.
  #
 -# WARNING: This program as such is intended to be used by professional
 -# programmers who take the whole responsability of assessing all potential
 -# consequences resulting from its eventual inadequacies and bugs
 -# End users who are looking for a ready-to-use solution with commercial
 -# garantees and support are strongly adviced to contract a Free Software
 -# Service Company
 +#    This program is distributed in the hope that it will be useful,
 +#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 +#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +#    GNU General Public License for more details.
  #
 -# This program is Free Software; you can redistribute it and/or
 -# modify it under the terms of the GNU General Public License
 -# as published by the Free Software Foundation; either version 2
 -# of the License, or (at your option) any later version.
 +#    You should have received a copy of the GNU General Public License
 +#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
 -# This program is distributed in the hope that it will be useful,
 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -# GNU General Public License for more details.
 -#
 -# You should have received a copy of the GNU General Public License
 -# along with this program; if not, write to the Free Software
 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -###############################################################################
 +##############################################################################
  
  #
  # Object relationnal mapping to postgresql module
@@@ -359,7 -366,7 +359,7 @@@ class orm_template(object)
                              view_load=%s, select_level=%s, readonly=%s ,required=%s
                          WHERE
                              model=%s AND name=%s""", (
--                                vals['model_id'], vals['field_description'], vals['ttype'], 
++                                vals['model_id'], vals['field_description'], vals['ttype'],
                                  vals['relation'], bool(vals['view_load']),
                                  vals['select_level'], bool(vals['readonly']),bool(vals['required']), vals['model'], vals['name']
                              ))
                          if val:
                              val2 = translation_obj._get_source(cr, user,
                                  self._name + ',' + f, 'selection',
--                                context.get('lang', False) or 'en_US', val)                   
++                                context.get('lang', False) or 'en_US', val)
                          sel2.append((key, val2 or val))
                      sel = sel2
                      res[f]['selection'] = sel
                      continue
  
                  ok = True
--            
++
                  if user != 1:   # admin user has all roles
                      serv = netsvc.LocalService('object_proxy')
                      user_roles = serv.execute_cr(cr, user, 'res.users', 'read', [user], ['roles_id'])[0]['roles_id']