on_change doesn't pass context, no translations on exceptions

Bug #900861 reported by Gustavo Adrian Marino
80
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP's Framework R&D
OpenERP Documentation
New
Undecided
Unassigned

Bug Description

This report is related to #537858
No context is passed on on_change events. That means that messages used in the event (like for example exceptions fired within the event) will be NOT translated by tools.translate '_()' method.
It is critical on system outside Europe and US

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Gustavo Adrian Marino ,

I have checked this issue at my end and as you said it not translate.
Currently in on change event osv.exception translation not implemented .So
I have set this issue as a wishlist.

Thanks for reporting!

affects: openobject-client → openobject-server
Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Gustavo Adrian Marino (gamarino) wrote : Re: [Bug 900861] Re: on_change doesn't pass context, no translations on exceptions

Hello Jignesh

I don't agree with the classification as wishlist.
In no way I asking for a new feature. No new feature from the point of view
of the customer, no new feature from the point of view of the announced
feature set of OpenERP (multilingual capabilites are claimed almost from
the very first versions of the system!).

You can discuss the severity of this fault. Perhaps, for europeans, having
some messages in English is not so critical.
That's not the case in Sud-America. In special, when something goes wrong
and it is necessary to correct data or to complete it, From my point of
view, this is no low priority issue.

It is clear that perhaps you are classifing the fault just following
internal reasons of OpenERP (availability of resources, complexity or real
possibility of getting something done). If that is the criteria, it is
really a big mistake.

It is an effort to spend time fixing problems, and it is well
appreciatiated by us. Please, do not under consider the effort writing and
following reports from the community side. It is very frustating to be
almost discarded (as it is usual with the wishlist status), even when
something it is clearly a fault! The only posible result of this policy is
getting always less input from community

Please, reconsider the evaluation
Regards

El 2 de abril de 2012 08:26, Jignesh Rathod(OpenERP) <
<email address hidden>> escribió:

> Hello Gustavo Adrian Marino ,
>
> I have checked this issue at my end and as you said it not translate.
> Currently in on change event osv.exception translation not implemented .So
> I have set this issue as a wishlist.
>
> Thanks for reporting!
>
> ** Project changed: openobject-client => openobject-server
>
> ** Changed in: openobject-server
> Importance: Undecided => Wishlist
>
> ** Changed in: openobject-server
> Status: New => Confirmed
>
> ** Changed in: openobject-server
> Assignee: (unassigned) => OpenERP's Framework R&D
> (openerp-dev-framework)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/900861
>
> Title:
> on_change doesn't pass context, no translations on exceptions
>
> Status in OpenERP Server:
> Confirmed
>
> Bug description:
> This report is related to #537858
> No context is passed on on_change events. That means that messages used
> in the event (like for example exceptions fired within the event) will be
> NOT translated by tools.translate '_()' method.
> It is critical on system outside Europe and US
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-server/+bug/900861/+subscriptions
>

--

Gustavo Adrian Marino

Mobile: +54 911 5498 2515

Email: <email address hidden>

Skype: gustavo.adrian.marino

Revision history for this message
Serge (sboivin) wrote :

+1

In quebec, canada, if you want enter in gouverment, you need ALL BY IN FRENCH, miss one translation and you will lose point.

Openerp do publicity on multi language, so this is a BUG not a wishlist !

Revision history for this message
Gustavo Adrian Marino (gamarino) wrote :

Serge:
Attached you will find my solution.
It solves the problem for all on_change methods, plus the workflow service
calls

If someone cares, it could be sometime introduced in the official release

Best regards

El 25 de abril de 2012 11:31, Serge <email address hidden> escribió:

> +1
>
> In quebec, canada, if you want enter in gouverment, you need ALL BY IN
> FRENCH, miss one translation and you will lose point.
>
> Openerp do publicity on multi language, so this is a BUG not a wishlist
> !
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/900861
>
> Title:
> on_change doesn't pass context, no translations on exceptions
>
> Status in OpenERP Server:
> Confirmed
>
> Bug description:
> This report is related to #537858
> No context is passed on on_change events. That means that messages used
> in the event (like for example exceptions fired within the event) will be
> NOT translated by tools.translate '_()' method.
> It is critical on system outside Europe and US
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-server/+bug/900861/+subscriptions
>

--

Gustavo Adrian Marino

Mobile: +54 911 5498 2515

Email: <email address hidden>

Skype: gustavo.adrian.marino

Revision history for this message
Serge (sboivin) wrote :

Thank for the patch,

but the fact is openerp LIE when they say "multilingual capabilites"

THEY CANT SAY THAT IF NOT ALL FEATURE ARE TRANSLATE.

As usual he does not care about customers, they only want sell contract, no contract no fix. But they need to rethink, too much bug, no customer !

Revision history for this message
Numérigraphe (numerigraphe) wrote :

Gustavo Adrian Marino (gamarino), you approach is interesting, would you care to make a merge proposal please?
Lionel Sausin.

Revision history for this message
Numérigraphe (numerigraphe) wrote :

Serge (sboivin), you're being rude and that's not an good way to have others fix things for you, for free.
The reasons this has not been fixed for ages have been explained elsewhere: to sum it up, it would break too many modules. No capitalist-from-hell logic at work here.
Actually the R&D team is working to a generic solution to this bug: making sure the context is passed implicitly. That should land in v7.0 according to the roadmap. Let's bear with them.
In the meantime, you can try Gustavo Adrian Marino (gamarino)'s patch and report here, or browse the user's language to make up a context in your own on_change function.
Lionel.

Revision history for this message
Numérigraphe (numerigraphe) wrote :

I've marked several bugs as duplicates of this one: subscribers, can you please give Gustavo Adrian Marino (gamarino)'s patch a try?
Lionel.

Revision history for this message
Gustavo Adrian Marino (gamarino) wrote :

Let me add a corrected version of the patch, it was also posted as a possible solution on https://bugs.launchpad.net/openobject-server/+bug/434266
The patch tries to solve problems on onchange and on workflow service calls
I will prepare a merge proposal

Revision history for this message
Carlos Matos Villar (carlosmvillar19) wrote :

The Bug is fixed... I could do it in this way!!
def onchange_remaining_seats(self,cr,uid,ids,seats,attendee_ids):
  res = {
   'value':{
    'remaining_seats_percent': self._get_remaining_seats_percent(seats,attendee_ids),
      }
    }
  if seats < 0:
   res['warning'] = {
      'title': _('Warning'),
      'message': _('You cannot have negative seats'),
      }

  return res

Revision history for this message
Numérigraphe (numerigraphe) wrote :

I can see the context was added to the signature of product_id_change() in sale_stock, so does the framework pass the context or does it not ?
the docs are not clear with this respect : they say you can get the context but the example given does not accept it!
https://doc.openerp.com/trunk/server/03_module_dev_03/#on-change
https://doc.openerp.com/6.0/developer/2_6_views_events/events/events/
Lionel Sausin.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.