account_rule's get_invoice_line in sale.py doesn't like line types that are not 'line'
confirming a sale gives the following with non 'line' type lines with the account_rule module activated.
Traceback (most recent call last):
File "/opt/trytond/trytond/protocols/dispatcher.py", line 204, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/model/modelview.py", line 720, in wrapper
return func(cls, records, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/sale/sale.py", line 1038, in process
cls._process_invoice(sales)
File "/opt/trytond/trytond/modules/sale/sale.py", line 1050, in _process_invoice
invoice = sale.create_invoice()
^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/sale_advance_payment/sale.py", line 380, in create_invoice
invoice = super(Sale, self).create_invoice()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/sale/sale.py", line 870, in create_invoice
invoice_lines.append(line.get_invoice_line())
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/sale_secondary_unit/sale.py", line 155, in get_invoice_line
lines = super().get_invoice_line()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/sale_option/sale.py", line 41, in get_invoice_line
lines = super().get_invoice_line()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/sale_advance_payment/sale.py", line 449, in get_invoice_line
lines = super(SaleLine, self).get_invoice_line()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/account_rule/sale.py", line 13, in get_invoice_line
return_=self.quantity < 0):
^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'NoneType' and 'int'
don't see immediately the use of 'return_' here, but in any event it should probably have a guard such as
return_=self.quantity < 0 if self.quantity else False