← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

Public bug reported:

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.

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

-- 
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:
  New

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.





Follow ups

References