← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 724057] Re: translation needs context but it doesn't always exist

 

Thank you for the new patch Albert.

Here is my view.
- I personally think, the patch paves a way to translate the warning/exception if anyhow the context is not passed to any method(note that this can be any method which is not an ORM method,could be your own written by you and it raises a warning),correct me if I am wrong.
- The only thing I fear is, the arguments. If the programmer is using arguments other than cr,cursor,uid,user; this could lead to a waste of time. Might be,Xrg is thinking this overhead,but this happens only in less than 1% of cases.

As far as the execution of this code is concerned, this is again gonna
happen in very rare number of cases.

In my view, as I already know why this was added on bug 432504 , this is
like fixing a leak of a pipe(as things work 99% accurate due to the
presence of context).

Thanks.

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

Title:
  translation needs context but it doesn't always exist

Status in OpenERP Server:
  Confirmed

Bug description:
  OpenERP v6:

  class GettextAlias in tools/translate.py requires a valid context
  available where _() was called. In some cases the context variable
  does not exsits or is not properly initialized. The attached patch
  provides a workarround by searching current user's language in order
  to find to which language it should translate.

  The patch is based on a Jay Vora patch provided in a v5 bug report:
  https://bugs.launchpad.net/openobject-addons/+bug/432504



References