← Back to team overview

openerp-india team mailing list archive

[Bug 1116401] [NEW] function name_get : context not passed

 

Public bug reported:

Hello all,

When i try to pass a context inside a view which contains a
product.product one2many fields for instance, the function name_get of
the product.product doesn't receive the context specified in the view.

By this way i can't give severa representations of a product name
depending context.

Only the base context is passed (lang, uid, etc...)

Is this a bug or should OpenERP work this way?


Bellow is my code :

def name_get( cr.... context):

if 'contextkey' in context :
#do something for this context

if 'contextkey2' in context :
# do something else

in my view :

<record id="view1" model="ir.ui.view">
<field name="context">{'contextkey1':1}</field>
....

and other view
<record id="view2" model="ir.ui.view">
<field name="context">{'contextkey2':1}</field>

i tried to add context on the concerned product.product field one2 many,
it works on edition (when i select the products) but when i save the
object, the context is not passed anymore and the default product name
displays.

Thank you.

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1116401

Title:
  function name_get : context not passed

Status in OpenERP Server:
  New

Bug description:
  Hello all,

  When i try to pass a context inside a view which contains a
  product.product one2many fields for instance, the function name_get of
  the product.product doesn't receive the context specified in the view.

  By this way i can't give severa representations of a product name
  depending context.

  Only the base context is passed (lang, uid, etc...)

  Is this a bug or should OpenERP work this way?


  Bellow is my code :

  def name_get( cr.... context):

  if 'contextkey' in context :
  #do something for this context

  if 'contextkey2' in context :
  # do something else

  in my view :

  <record id="view1" model="ir.ui.view">
  <field name="context">{'contextkey1':1}</field>
  ....

  and other view
  <record id="view2" model="ir.ui.view">
  <field name="context">{'contextkey2':1}</field>

  i tried to add context on the concerned product.product field one2
  many, it works on edition (when i select the products) but when i save
  the object, the context is not passed anymore and the default product
  name displays.

  Thank you.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1116401/+subscriptions


Follow ups

References