Error in the sale_point if the product has no price
When we try to add a sales line on the sale_point module with a product that has no price, we get the following error (here reproduced with a scenario):
Exception raised:
Traceback (most recent call last):
File "/home/xt0ph/.pyenv/versions/3.8.6/lib/python3.8/doctest.py", line 1336, in __run
exec(compile(example.source, filename, "single",
File "<doctest scenario_sale_point.rst[69]>", line 1, in <module>
line.product = goods
File "/home/xt0ph/Documents/technique/tryton/test/tryton/proteus/proteus/__init__.py", line 288, in __set__
super(Many2OneDescriptor, self).__set__(instance, value)
File "/home/xt0ph/Documents/technique/tryton/test/tryton/proteus/proteus/__init__.py", line 129, in __set__
instance._on_change([self.name])
File "/home/xt0ph/Documents/technique/tryton/test/tryton/proteus/proteus/__init__.py", line 1147, in _on_change
changes = getattr(self._proxy, 'on_change')(values, names, context)
File "/home/xt0ph/Documents/technique/tryton/test/tryton/proteus/proteus/config.py", line 215, in __call__
meth(inst, *c_args, **c_kwargs))
File "/home/xt0ph/Documents/technique/tryton/test/tryton/trytond/trytond/model/modelview.py", line 742, in on_change
method()
File "/home/xt0ph/Documents/technique/tryton/test/tryton/trytond/trytond/model/modelview.py", line 31, in wrapper
result = func(self, *args, **kwargs)
File "/home/xt0ph/Documents/technique/tryton/test/tryton/trytond/trytond/model/fields/field.py", line 124, in wrapper
return func(self, *args, **kwargs)
File "/home/xt0ph/Documents/technique/tryton/test/tryton/trytond/trytond/modules/sale_point/sale.py", line 542, in on_change_product
taxes = Tax.compute(
File "/home/xt0ph/Documents/technique/tryton/test/tryton/trytond/trytond/modules/account/tax.py", line 1094, in compute
res = cls._unit_compute(taxes, price_unit, date)
File "/home/xt0ph/Documents/technique/tryton/test/tryton/trytond/trytond/modules/account/tax.py", line 1019, in _unit_compute
values.append(tax._process_tax(price_unit))
File "/home/xt0ph/Documents/technique/tryton/test/tryton/trytond/trytond/modules/account/tax.py", line 989, in _process_tax
amount = price_unit * self.rate
TypeError: unsupported operand type(s) for *: 'NoneType' and 'decimal.Decimal'