Skip to content
Snippets Groups Projects
Commit 98e5673c authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] product: sort pricelist items by sequence

The pricelist items should be sorted by sequence.

opw-660745
parent 44e65e72
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,7 @@ class product_pricelist(osv.osv):
'AND (categ_id IS NULL OR categ_id = any(%s)) '
'AND (pricelist_id = %s) '
'AND ((i.date_start IS NULL OR i.date_start<=%s) AND (i.date_end IS NULL OR i.date_end>=%s))'
'ORDER BY applied_on, min_quantity desc',
'ORDER BY sequence, applied_on, min_quantity desc',
(prod_tmpl_ids, prod_ids, categ_ids, pricelist.id, date, date))
item_ids = [x[0] for x in cr.fetchall()]
......@@ -251,7 +251,7 @@ class product_pricelist(osv.osv):
class product_pricelist_item(osv.osv):
_name = "product.pricelist.item"
_description = "Pricelist item"
_order = "applied_on, min_quantity desc"
_order = "sequence, applied_on, min_quantity desc"
def _check_recursion(self, cr, uid, ids, context=None):
for obj_list in self.browse(cr, uid, ids, context=context):
......
......@@ -134,6 +134,7 @@
<separator string="Pricelist Items"/>
<field name="item_ids" nolabel="1" context="{'default_base':'list_price'}">
<tree string="Pricelist Items">
<field name="sequence" widget="handle"/>
<field name="name" string="Applicable On"/>
<field name="min_quantity"/>
<field name="date_start"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment