Report sales by category of products has divide by zero error

Bug #720919 reported by Don Kirkby
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned
5.0
Won't Fix
Low
Jay Vora (Serpent Consulting Services)

Bug Description

If some sales order lines have negative quantities, then the total units sold for a month in a particular category and sales order state can be zero. If the total is zero, then you can get a divide by zero in the Sales by Category of Products report that is part of the report_sale module.

Detailed steps to reproduce:
1. Create a new database with demo data. Select the manufacturing industry profile and leave all the other settings as the defaults.
2. Install the report_sale module.
3. Create a new sales order.
4. Set the customer to Agrolait and the date ordered to one month ago.
5. Add a new sales order line with all the default fields, plus Product Uom PCE, description "Paper plate", and unit price 2.00.
6. Add a second line with all the default fields, plus Quantity UoM -1.00, Product Uom PCE, description "Napkin", and unit price 1.00.
7. Confirm the sale order.
8. From the Sales menu, choose Reporting: All Months: Sales by Category of Products.

Expected behaviour: see the chart.

Actual behaviour: Division by zero error.

I am running OpenERP 5.0.15 on Ubuntu 10.04.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Don Kirkby,

I have checked your issue but your scenario does not correct.
Because from your scenario you have confirmed a sale order with negative quantity but we have set a restriction of the negative quantity in sale order see the line no 946 of mrp.py.

So how can you confirmed your sale order?
Please provide the more information on this.

I have attached a screen-shot for your reference, So please check it.

Thanks.

Revision history for this message
Amit Parik (amit-parik) wrote :
Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Don Kirkby (donkirkby) wrote :

Hi Amit Parik,

Thanks for trying to verify my bug. To reproduce the error, do not choose a product for the sales order lines, just type in a description. When there's no product, it doesn't generate a procurement, and so the check you mentioned is not performed.

yours,
Don Kirkby

Changed in openobject-addons:
status: Incomplete → New
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Don Kirkby,

Thanks for your reply and I am confirming this issue in 5.0.

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello,

This doesn't happen on version 6.0.
For the sake of minimum risk on version 5.0,we would like to ask you to contact Maintenance team via OpenERP Publisher Warranty.

Moreover, you could have selected positive qty in order to make this work for you.

Thanks for understanding.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.