diff options
| author | Olivier Dony <odo@openerp.com> | 2013-09-06 18:14:22 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2013-09-06 18:14:22 +0200 |
| commit | 54a8cbb7cd82845122ab3ed004529a9d06d2ed32 (patch) | |
| tree | 74e7455ac9b27709494a5d3aab5a758435a56261 /addons/analytic_user_function/analytic_user_function_view.xml | |
| parent | 8c2b5d23161fcadc360061835f2322dde56149c8 (diff) | |
| parent | 6de0051315daaeb6e49a9caa151bce338738187b (diff) | |
[MERGE] product: support string values for context `pricelist` key when computing prices
As of v7 search views will replace the value of any `self`
literal in a @context attribute by the name of the
record, whereas it used to be its ID.
This means that the `Pricelist` filter used to display
the product list with a specific pricelist would not
work anymore.
The fix requires a rather hackish name_search()
override for product.pricelist because the display
name of pricelists includes their currency, while
that could be a valid name for a pricelist too.
To avoid side-effects the name_search() override
only picks up the special case used by the
product.product._product_price() method when it
tries to apply the context pricelist, that is
with operator explicitly set to `=` and no extra
domain `args`.
Also avoid useless warning in log by disabling the actual
filtering for the dummy pricelist_id field, whose
only purpose is to alter the context.
Finally, add a default _order for pricelists that is
a bit more intuitive than the default sort by `id`.
An explicit _order was required for the application of
the `limit` in pure SQL, and using `name` seems slightly
better than `id`.
lp bug: https://launchpad.net/bugs/1178835 fixed
bzr revid: odo@openerp.com-20130906161422-0huf2uwjg42shdqp
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function_view.xml')
0 files changed, 0 insertions, 0 deletions
