missing to_uom when process sale that has not uom, but user add uom in invoice line
Scenario:
- Create a Sale:
- Set the invoice method to "From Order."
- Add a line without selecting a product, specifying only the quantity and unit price. Process the Sale:
- Confirm and process the sale: an invoice draft is created.
- Edit the Invoice Line:
- Add a unit of measure (UoM) to the line and save the changes.
- Process the sale again:
Traceback (most recent call last):
File "/tryton/trytond/trytond/worker.py", line 144, in run_task
task.run()
File "/tryton/trytond/trytond/ir/queue_.py", line 177, in run
getattr(Model, self.data['method'])(
File "/tryton/trytond/trytond/model/modelview.py", line 720, in wrapper
return func(cls, records, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tryton/trytond/trytond/modules/sale/sale.py", line 1049, in process
cls._process_invoice(sales)
File "/tryton/trytond/trytond/modules/sale_invoice_grouping/sale.py", line 62, in _process_invoice
super()._process_invoice([sale])
File "/tryton/trytond/trytond/modules/sale/sale.py", line 1061, in _process_invoice
invoice = sale.create_invoice()
^^^^^^^^^^^^^^^^^^^^^
File "/tryton/trytond/trytond/modules/sale_invoice_line_standalone/sale.py", line 39, in create_invoice
invoice_lines.extend(line.get_invoice_line())
^^^^^^^^^^^^^^^^^^^^^^^
File "/tryton/trytond/trytond/modules/sale_invoice_line_standalone/sale.py", line 87, in get_invoice_line
invoice_lines = super(SaleLine, self).get_invoice_line()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tryton/trytond/trytond/modules/sale/sale.py", line 1710, in get_invoice_line
- self._get_invoiced_quantity())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tryton/trytond/trytond/modules/sale/sale.py", line 1784, in _get_invoiced_quantity
quantity += Uom.compute_qty(
^^^^^^^^^^^^^^^^
File "/tryton/trytond/trytond/modules/product/uom.py", line 200, in compute_qty
raise ValueError("missing to_uom")
ValueError: missing to_uom