|
@@ -9,7 +9,7 @@ from openerp import tools
|
|
|
|
|
|
class my_report_model(osv.osv):
|
|
|
_name = "my.report.model"
|
|
|
- _description = "Listado de productos más vendidos"
|
|
|
+ _description = "Listado de productos mas vendidos"
|
|
|
_auto = False
|
|
|
_columns = {
|
|
|
'product_id': fields.many2one('product.product', string='Producto', required=True, readonly=True),
|
|
@@ -17,7 +17,7 @@ class my_report_model(osv.osv):
|
|
|
'suma': fields.float('Cantidad', readonly=True),
|
|
|
'lastdate': fields.date('Fecha Ult.Venta', readonly=True)
|
|
|
}
|
|
|
- # _order = 'suma ASC'
|
|
|
+ _order = 'suma ASC'
|
|
|
|
|
|
def init(self, cr):
|
|
|
tools.sql.drop_view_if_exists(cr, 'my_report_model')
|
|
@@ -31,7 +31,7 @@ class my_report_model(osv.osv):
|
|
|
c.lastdate
|
|
|
FROM product_template a
|
|
|
LEFT JOIN(select product_id AS product_id,name AS nombre,SUM(product_uom_qty) AS pos , MAX(create_date) AS lastdate from sale_order_line group by product_id,name) c on c.product_id=a.id
|
|
|
- WHERE c.pos>0 ORDER BY c.pos DESC
|
|
|
+ WHERE c.pos>0
|
|
|
)
|
|
|
""")
|
|
|
my_report_model()
|