Recompute fixed cost price may return None
When a new company is created, the cost_price
of products may be None
but recompute_cost_price_fixed
return the cost price of the product.
This leads to such traceback:
Traceback (most recent call last):
File "/tryton/trytond/trytond/worker.py", line 135, in run_task
task.run()
File "/tryton/trytond/trytond/ir/queue_.py", line 178, in run
getattr(Model, self.data['method'])(
File "/tryton/trytond/trytond/modules/stock/product.py", line 321, in recompute_cost_price
cost = round_price(cost)
^^^^^^^^^^^^^^^^^
File "/tryton/trytond/trytond/modules/product/product.py", line 49, in round_price
return value.quantize(
^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'quantize'
Indeed the other recompute_cost_price_*
are all returning 0 by default.