Crash on purchase when purchase line has no amount
The following crash occurs when line amount is empty
Traceback (most recent call last):
File "usrlocallibpython3.11dist-packagestrytondwsgi.py", line 96, in dispatch_request
return endpoint(request, **request.view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondprotocolsdispatcher.py", line 44, in rpc
return methods.get(request.rpc_method, _dispatch)(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondwsgi.py", line 76, in wrapper
return func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondprotocolswrappers.py", line 206, in wrapper
result = func(request, pool, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondprotocolsdispatcher.py", line 216, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondmodelmodelsql.py", line 1247, in read
getter_results = field.get(
^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondmodelfieldsfunction.py", line 27, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondtransaction.py", line 50, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondmodelfieldsfunction.py", line 168, in get
return call(names)
^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondmodelfieldsfunction.py", line 124, in call
values = method(records, name)
^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondmodulesaccount_cash_roundingpurchase.py", line 45, in get_amount
amounts = super().get_amount(purchases, names)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "usrlocallibpython3.11dist-packagestrytondmodulespurchasepurchase.py", line 556, in get_amount
untaxed_amount[purchase.id] = sum(
^^^^
TypeError: unsupported operand type(s) for +: 'decimal.Decimal' and 'NoneType'
Edited by Ahmed AlBoori