← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 724954] Re: [6.0.1] active_id in context attribute of act_window tag gets stored incorrectly [with fix]

 

Hello Russell,

Here you have raised the issue of storing the context in a table
ir_act_window. You are right that the active_id variable is stored as
'active_id' in database. But if you have faced any error then it must
not be the reason. We are storing the context in similar ways of all
act_window throughout the system.

One more thing to suggest if you are passing the active_id in the
context then pass like [active_id].

Right now I am closing this bug, as the issue is not raised due to the
wrong form of storage of value in database, but you can reopen it later
with the traceback which you got in the web client.

Thanks for your participation.

** Changed in: openobject-server
       Status: New => Invalid

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/724954

Title:
  [6.0.1] active_id in context attribute of act_window tag gets stored
  incorrectly [with fix]

Status in OpenERP Server:
  Invalid

Bug description:
  For example, I have an act_window tag as follows:

          <act_window
              id="action_partner_job_task_new"
              name="New Task"
              res_model="job.task"
              src_model="res.partner"
              view_type="form"
              view_mode="form"
              context="{'partner_id' : active_id}" />

  Once this action is imported into the database, the value of 'context'
  in the ir_act_window table is:

  {'partner_id' : 'active_id'}

  The server has incorrectly converted the active_id variable into a
  string: 'active_id'. This causes errors in the web client when the
  action is linked from a button.

  The following patch resolves this issue:

  
  === modified file bin/tools/convert.py
  --- bin/tools/convert.py	2010-12-29 10:50:04 +0000
  +++ bin/tools/convert.py	2011-02-25 12:24:41 +0000
  @@ -459,7 +459,7 @@
               'limit': limit,
               'auto_refresh': auto_refresh,
               'uid' : uid,
  -            'active_id': active_id,
  +            #'active_id': active_id, # XXX Causes 'active_id' to be stored instead of active_id
               'ref' : ref,
           }
           context = self.get_context(data_node, rec, eval_context)



References