← Back to team overview

openerp-dev-web team mailing list archive

[Bug 702568] Re: Company ignored after editing Preferences

 

Hello Nicolas,

Your analysis is correct, and your patch is not bad, but the problem is
larger, and not limited to changing the company. For example if you try
to turn off the 'menu tips' in the preferences you will see that it
fails too.

This is the trace of a sample RPC call from the web client when changing
the preferences:

['test_00_1',
 1,
 '*',
 'res.users',
 'write',
 [1],
 {'company_id': '3',
  'context_lang': 'en_US',
  'context_project_id': '',
  'context_section_id': '',
  'context_tz': '',
  'menu_tips': '1',
  'signature': 'Administrator',
  'user_email': '',
  'view': 'extended'}]

As you can see, the company_id and menu_tips values are passed as
strings instead of, respectively, integer and boolean.

This is a problem in the web client, and applying your suggested patch
on the server would indeed be a workaround for the company setting, but
we need solve the root cause as well.

This issue is under investigation by the web client team.

Thanks for reporting!

** Project changed: openobject-server => openobject-client-web

** Changed in: openobject-client-web
   Importance: Undecided => Medium

** Changed in: openobject-client-web
       Status: New => Confirmed

** Changed in: openobject-client-web
     Assignee: (unassigned) => OpenERP SA's Web Client R&D (openerp-dev-web)

** Changed in: openobject-client-web
       Status: Confirmed => In Progress

** Changed in: openobject-client-web
    Milestone: None => 6.0

-- 
You received this bug notification because you are a member of OpenERP
SA's Web Client R&D, which is a bug assignee.
https://bugs.launchpad.net/bugs/702568

Title:
  Company ignored after editing Preferences

Status in OpenObject Web Client:
  In Progress

Bug description:
  While testing multi-company functionality on my OpenERP 6.0 RC2 (on
  Windows 7), I see that nothing happens when I try to switch companies
  from the EDIT PREFERENCES window.

  Upon closer look to the source code, I find that there is indeed a validation that checks whether the selected company is assigned to the logged user in \addons\base\res\res_user.py (line 368):
         if not (values['company_id'] in self.read(cr, uid, uid, ['company_ids'], context=context)['company_ids']):

  However, the selected company IS assigned to me, which I can confirm by simply watching the variables used in this code line. I find that by simply converting the id from the 'values' list to integer, the condintion works correctly:
         if not (int(values['company_id']) in self.read(cr, uid, uid, ['company_ids'], context=context)['company_ids']):

  After introducing this change to my RC2 installation, the modified
  company is saved correctly (although the web page's header doesn't
  reflect the change even after refreshing it, something I should
  probably report in the WebServer project)

  Hope I got this right, as I am new to OpenERP. Thanks.