← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 865308] Re: Context is not evaluted on one2many fields

 

Hello Thibault.

Please note there are some problems in your bug report.

I see this:
<field name="fake_object_child_ids" context="{'this_does_not_work' : date, 'neither_this' : active_id}"/>

You don't tell me what 'date' represents. Is it a field? Something else?

Just telling me "Context is not evaluted on one2many fields" is not
sufficient, and I know it's not true. I could cite you 10 examples in
the OpenERP addons where that works. I don't say there is no bugs at
all, that it works 100% of the time, but if I don't have enough
information to reproduce this bug locally I can't resolve it, I can't
even decide if it's a bug.

Plus you seem to conclude the active_id is not usable by simply relying
on this same test, despite the fact that this test clearly fails due to
that 'date' value that the context evaluator is not able to find.

Also please note that we know the web client stops when it encounters an
error. That's a decision we made that the new web client would be less
tolerant than the gtk client or the old web client, it was made on
purpose and won't be changed. We prefer our program to completely crash
with a big message when it encounters an error rather than trying to
make stupid things to build an illusion of a working application.

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

Title:
  Context is not evaluted on one2many fields

Status in OpenERP Web:
  Incomplete

Bug description:
  Hi,

  I'm working on the trunk branch (updated this morning). When
  specifying a context on a one2many field in its "field" XML atg, it
  doesn't work. I join a module so you can test and reproduce the bug
  easily.

  Example :

  <!-- A many2one, it's ok -->
  <field name="user_id" context="{'temporal_date' : date, 'dummy' : active_id}"/>
  <!-- A one2many, it's does't work -->
  <field name="fake_object_child_ids" context="{'this_does_not_work' : date, 'neither_this' : active_id}"/>

  I got this error on GTK client :

  Traceback (most recent call last):
    File "/home/thibaut/OpenERP 6/Logica/client/bin/tools/__init__.py", line 52, in expr_eval
      temp = eval(string, context)
    File "<string>", line 1, in <module>
  NameError: name 'date' is not defined

  And the same error with the active_id variable, whereras the first
  context work perfectly fine.

  This is going to be a problem for the future base_temporal module : we
  won't be able to pass the temporal_date variable in the context based
  on a current form field. Moreover, not being able to use active_id in
  the context of a one2many field also is a problem to define default
  values in the one2many form view.

  I hope this could be fixed before the 6.1 (7.0? ;-) !

  Thanks for your time,

To manage notifications about this bug go to:
https://bugs.launchpad.net/openerp-web/+bug/865308/+subscriptions


References