Comment 4 for bug 693056

Revision history for this message
snook (snook) wrote :

Hi Ron,

Had a quick look at the new code and looks like part of the problem is solved.

However, code below does not seem correct to me. Perhaps better variable naming would not mask the problem:

166 # product.pricelist.version:
167 if pricelist_ids:
168 pricelist_version_ids = pricelist_ids
169 else:
170 # all pricelists:
171 pricelist_version_ids = product_pricelist_version_obj.search(cr, uid, [])
172
173 pricelist_version_ids = list(set(pricelist_version_ids))
174
175 plversions_search_args = [
176 ('pricelist_id', 'in', pricelist_version_ids),
177 '|',
178 ('date_start', '=', False),
179 ('date_start', '<=', date),
180 '|',
181 ('date_end', '=', False),
182 ('date_end', '>=', date),
183 ]
184
185 plversion_ids = product_pricelist_version_obj.search(cr, uid, plversions_search_args)

What does not look correct to be is:

1. Line 168 is placing "pricelist_ids" into a variable called "pricelist_version_ids"
    and line: 171 is placing "pricelist_version_ids" into same variable (variable may contain "ids" of two different objects)

2. Line 176 is matching "pricelist_ids" against "pricelist_version_ids" if line: 171 is executed

Code prior to "price_get_multi()" converted incoming pricelist_ids into associated pricelist_version_ids before continuing.

That seems to be the problem here.

The argument "pricelist_ids" are not converted to related "pricelist_version_ids"

regards