Sales: status "waiting" - invoice: status"payed"

Hello friends,

I my sales list, there is one incident with invoice status “waiting”.
When I open it and look at the corresponding invoice, that one has status “payed”.

There is only that single sale, and only one single invoice, AFAIK no cancellations etc.
What could I have done wrong?

Cheers,
Wolf

Did you tried using the “Process” button of the sale? Does it show any error? Does it create a new invoice?

In fact you’re right - the “process” button still shows up. Sorry, I should have seen that.
When I press it, I get this error:

missing to_uom

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 110, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 47, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 77, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 131, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 181, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/kopen_web_shop_woocommerce-5.6.0-py3.8.egg/trytond/modules/web_shop_woocommerce/web.py", line 521, in process
    super().process(sales)
  File "/trytond/model/modelview.py", line 729, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/modules/sale/sale.py", line 958, in process
    sale.create_invoice()
  File "/trytond/modules/sale/sale.py", line 788, in create_invoice
    invoice_lines.append(line.get_invoice_line())
  File "/trytond/modules/sale/sale.py", line 1399, in get_invoice_line
    - self._get_invoiced_quantity())
  File "/trytond/modules/sale/sale.py", line 1473, in _get_invoiced_quantity
    quantity += Uom.compute_qty(invoice_line.unit,
  File "/trytond/modules/product/uom.py", line 198, in compute_qty
    raise ValueError("missing to_uom")
ValueError: missing to_uom

Fault: missing to_uom

HTH, Wolf

It seems there Sale uom is missing which causes the crash.

I guess there is some invoice line which was manually linked to some sale line without a product and this causes the issue.

Fixing the data should solve the issue.

Sorry but i can’t say more without seeing the data.

Right - do I need to edit the database for that? - I’ve got access to PGAdmin - it that the proper tool, and where would I have to dig into?

Thank you so much!
Wolf

If the sale is process and the invoice is already posted: yes you should update the data on the database.

But you can find the wrong line from the user interface.

Basically you need to search for sale lines without Unit set which have a related invoice line (using the origin refernece) that has a Unit set.

Right - I found one line without a unit in “sales”, the corresponding item in “invoices” has a unit set. What could I do? - In the “sales” section, I cannot make any changes, everything is grayed. So do I need to edit the database with pgadmin?

Thank you so much!

Yes, the only option is to update the sale unit by using a database tool.

Once you have set a value for it, using the process button should fix the states.