Vauxoo / odoo

Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
https://www.odoo.com
Other
9 stars 9 forks source link

[FIX] base: Avoid error when keep_query is not used in an httprequest context #262

Closed luisg123v closed 6 years ago

luisg123v commented 6 years ago

When the utility method keep_query() is used outside an httprequest context (e.g. rendering a template from a unittest) the following exception is throwng: RuntimeError: object unbound

The above exception is caused by the method trying to retrieve parameters from the HTTP request, even if the request object is unbownd.

This change ensures those parameters are retrieved only when exists, making possible to use it outside the web client

Closes #18841

-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

hugho-ad commented 6 years ago

@luisg123v please submit the issue https://github.com/odoo/odoo/issues/18841 by opw

luisg123v commented 6 years ago

@hugho-ad Sorry, I was supposed to report this at odoo/odoo, not vauxoo/odoo. I'll report this there first, and then I'll submit an opw ticket.

luisg123v commented 6 years ago

I've submitted this to odoo/odoo#22942, so I'm closing this PR.