Ok, I thought I was done with it, but there is still another really annoying bug with the nan_product_pack:
I checked the option "Pack has fixed price" for the product that is a pack, to make the price of the product the sum of the component's prices. So in the product form, the sale price is 0.
The problem is, when I want to make a sales order with this product, at the time I select the product in Order line creation, I get an error "Float division by zero" and so the form is not completely filled, I have to do it manually.
This comes from my sales pricelist, that applies to all products to calculate discount from the sale price.
So it wants to calculate discount for the Pack product, and that leads to a division by zero !
Is there a way to avoid that ? Or Python module must be manually modified not to take account prices equal to 0 in price lists ?
Here is the error log:
Code:
[2011-09-29 10:50:17,248][testRealDatas] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
return f(self, dbname, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openerp-server/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/local/lib/python2.7/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/local/lib/python2.7/dist-packages/openerp-server/addons/product_visible_discount/product_visible_discount.py", line 96, in product_id_change
discount = (new_list_price - price) / new_list_price * 100
ZeroDivisionError: float division by zero
[2011-09-29 10:50:18,330][testRealDatas] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
return f(self, dbname, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openerp-server/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/local/lib/python2.7/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/local/lib/python2.7/dist-packages/openerp-server/addons/product_visible_discount/product_visible_discount.py", line 96, in product_id_change
discount = (new_list_price - price) / new_list_price * 100
ZeroDivisionError: float division by zero