[IMP][REM] product: removed unused code from product price list report wizard with some report improvement.

bzr revid: vra@tinyerp.com-20100922070043-zbuhej0ik8dwc0o2
This commit is contained in:
vra 2010-09-22 12:30:43 +05:30
parent f5f878b719
commit b64fe585fb
3 changed files with 7 additions and 5 deletions

View File

@ -87,9 +87,12 @@ class product_pricelist(report_sxw.rml_parse):
pro_ids.append(product.id)
if product.categ_id.id not in cat_ids:
cat_ids.append(product.categ_id.id)
cats = pool.get('product.category').read(self.cr, self.uid, cat_ids, ['name'])
cats = pool.get('product.category').name_get(self.cr, self.uid, cat_ids)
if not cats:
return res
for cat in cats:
product_ids=pool.get('product.product').search(self.cr, self.uid, [('id','in',pro_ids),('categ_id','=',cat['id'])])
product_ids=pool.get('product.product').search(self.cr, self.uid, [('id','in',pro_ids),('categ_id','=',cat[0])])
products = []
for product in pool.get('product.product').read(self.cr, self.uid, product_ids, ['name','code']):
val = {
@ -105,7 +108,7 @@ class product_pricelist(report_sxw.rml_parse):
val['qty'+str(i)]=self._get_price(self.pricelist, product['id'], qty)
i += 1
products.append(val)
res.append({'name':cat['name'],'products': products})
res.append({'name':cat[1],'products': products})
return res
def _get_price(self,pricelist_id, product_id,qty):

View File

@ -191,7 +191,7 @@
</blockTable>
<section>
<para style="terp_default_1">[[repeatIn(get_categories(objects,data['form']), 'c')]]</para>
<blockTable colWidths="167.0,372.0" style="Table_category">
<blockTable colWidths="230.0,309.0" style="Table_category">
<tr>
<td>
<para style="terp_default_Bold_9">[[ c['name'] ]]</para>

View File

@ -51,7 +51,6 @@ class product_price_list(osv.osv_memory):
datas = {'ids': context.get('active_ids', [])}
res = self.read(cr, uid, ids, ['price_list','qty1', 'qty2','qty3','qty4','qty5'], context)
res = res and res[0] or {}
price_dict = self.pool.get('product.pricelist').price_get(cr, uid, [res['price_list']], 1, 1.0)
datas['form'] = res
return {
'type': 'ir.actions.report.xml',