Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when invoicing multiple sale orders #1322

Open
TelmoSuarez opened this issue Jul 17, 2024 · 1 comment
Open

Exception when invoicing multiple sale orders #1322

TelmoSuarez opened this issue Jul 17, 2024 · 1 comment
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.

Comments

@TelmoSuarez
Copy link

Module

account_payment_sale

Describe the bug

When trying to invoice 2 or more sale orders and some having payment mode and others having it blank throws python exception.

Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 1632, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo/http.py", line 1659, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/http.py", line 1863, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/http.py", line 716, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/addons/web/controllers/dataset.py", line 46, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 468, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/addons/sale/wizard/sale_make_invoice_advance.py", line 149, in create_invoices
self._create_invoices(self.sale_order_ids)
File "/opt/odoo/addons/sale/wizard/sale_make_invoice_advance.py", line 161, in _create_invoices
return sale_orders._create_invoices(final=self.deduct_down_payments)
File "/opt/odoo/addons/sale/models/sale_order.py", line 1149, in _create_invoices
invoice_vals_list = sorted(
TypeError: '<' not supported between instances of 'NoneType' and 'int'

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPC_ERROR
at makeErrorFromResponse (http://oca-bank-payment-16-0-b6a3937ce8b9.runboat.odoo-community.org/web/assets/448-1b8fd59/web.assets_backend.min.js:997:163)
at XMLHttpRequest. (http://oca-bank-payment-16-0-b6a3937ce8b9.runboat.odoo-community.org/web/assets/448-1b8fd59/web.assets_backend.min.js:1005:13)

To Reproduce

Affected versions:16.0

Steps to reproduce the behavior:

  1. Install account_payment_sale
  2. Create 2 sales.
  3. Establish payment mode in one order and leave it blank in the other.
  4. Invoice both sales.

Expected behavior
Generates invoices and doesn't throw exception.

Copy link

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

No branches or pull requests

1 participant