[FIX] sale, sales analysis: fixed traceback when a line without product was present in the database.

bzr revid: qdp-launchpad@openerp.com-20130320115521-3h5gh66gul54zqxn
This commit is contained in:
Quentin (OpenERP) 2013-03-20 12:55:21 +01:00
commit 7502967a47
2 changed files with 3 additions and 4 deletions

View File

@ -88,12 +88,11 @@ class sale_report(osv.osv):
s.project_id as analytic_account_id
from
sale_order s
left join sale_order_line l on (s.id=l.order_id)
join sale_order_line l on (s.id=l.order_id)
left join product_product p on (l.product_id=p.id)
left join product_template t on (p.product_tmpl_id=t.id)
left join product_uom u on (u.id=l.product_uom)
left join product_uom u2 on (u2.id=t.uom_id)
where l.product_id is not null
group by
l.product_id,
l.product_uom_qty,

View File

@ -68,8 +68,8 @@ class sale_report(osv.osv):
s.project_id as analytic_account_id
from
sale_order s
left join sale_order_line l on (s.id=l.order_id)
left join product_product p on (l.product_id=p.id)
join sale_order_line l on (s.id=l.order_id)
left join product_product p on (l.product_id=p.id)
left join product_template t on (p.product_tmpl_id=t.id)
left join product_uom u on (u.id=l.product_uom)
left join product_uom u2 on (u2.id=t.uom_id)