← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 701485] Re: [trunk version 3226] Problem with eval in xml

 

Like i say is not a important bug

But when you write your xml, if you do a eval , eval use DateTime, so in
xml need to write DateTime,  but when you add a color condition in a
tree view in xml, you need to use datetime.

it's not important, but we need to remember for eval is DateTime and for
colour is datetime.

My point is .. Why we can use always datetime, we already have lot of
thing to remember.

Anyway is not important, just take a note on that and maybe in a future
version that will me corrected ;)

-- 
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/701485

Title:
  [trunk version 3226] Problem with eval in xml

Status in OpenObject Server:
  Invalid

Bug description:
  First i know is not really important but, this bug dont help us to
  program easy.

  In xml is you create a scheduler with a EVAL in, server create a dict
  with function _get_idref from server/bin/tools

  
  def _get_idref(self, cr, uid, model_str, context, idref):
      idref2 = dict(idref,
                    time=time,
                    DateTime=datetime,
                    timedelta=timedelta,
                    version=release.major_version,
                    ref=_ref(self, cr),
                    pytz=pytz)
      if len(model_str):
          idref2['obj'] = _obj(self.pool, cr, uid, model_str, context=context)
      return idref2

  
  You see DateTime not datetime... dunno why... in this case is a D and T caps

  
  anyway, we continue.... 

  If you create color in a tree view, dict create in web client with
  function expr_eval in addons/openerp/utils

  def expr_eval(string, context=None):
      context = dict(context or {},
                     uid=rpc.session.uid,
                     current_date=time.strftime('%Y-%m-%d'),
                     time=time,
                     datetime=datetime,
                     relativedelta=relativedelta)

  you see datetime, no caplock ... so .. sometime we need to write
  DateTime, and other time datetime, dunno why but yesterday i lost some
  time because of that, maybe is to complicate to correct that.

  
  It's not a important bug, but that not clean.





References