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

[14.0] POS_order_return error payment #937

Closed
JulienMartinez opened this issue Feb 28, 2023 · 8 comments
Closed

[14.0] POS_order_return error payment #937

JulienMartinez opened this issue Feb 28, 2023 · 8 comments
Labels

Comments

@JulienMartinez
Copy link

Module

POS_order_return

Describe the bug

The problem on the POS_order_return is related to the option on the POS "stock movement in real time"

To Reproduce

Affected versions: 14.0

Steps to reproduce the behavior:

  1. Go to POS settings
  2. Activate sotck movement in real time
  3. Make a sale in the POS
  4. Use the button Return items
  5. Make the refund
  6. And observe the Error Python

Expected behavior
Validate the refund and perform the stock movement of the items

@legalsylvain
Copy link
Contributor

Hi @JulienMartinez. thanks for reporting. could you copy paste the python error log ?
thanks !

@JulienMartinez
Copy link
Author

Hi @legalsylvain here is the python error ,

regards .

Erreur:
Odoo Server Error

Traceback (most recent call last):
  File "/home/odoo_14/server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/home/odoo_14/server/odoo/http.py", line 685, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo_14/server/odoo/http.py", line 361, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo_14/server/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo_14/server/odoo/http.py", line 349, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo_14/server/odoo/http.py", line 908, in __call__
    return self.method(*args, **kw)
  File "/home/odoo_14/server/odoo/http.py", line 533, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo_14/server/addons/web/controllers/main.py", line 1376, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/home/odoo_14/server/addons/web/controllers/main.py", line 1364, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo_14/server/odoo/api.py", line 399, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/odoo_14/server/odoo/api.py", line 386, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo_14/additionnal_repositories/OCA-pos/pos_customer_required/models/pos_make_payment.py", line 29, in check
    return super(PosMakePayment, self).check()
  File "/home/odoo_14/server/addons/point_of_sale/wizard/pos_payment.py", line 59, in check
    order._create_order_picking()
  File "/home/odoo_14/additionnal_repositories/OCA-pos/pos_order_return/models/pos_order.py", line 141, in _create_order_picking
    res = wizard.create_returns()
  File "/home/odoo_14/server/addons/stock/wizard/stock_picking_return.py", line 175, in create_returns
    new_picking_id, pick_type_id = wizard._create_returns()
  File "/home/odoo_14/server/addons/delivery/models/stock_picking.py", line 312, in _create_returns
    new_picking, pick_type_id = super(StockReturnPicking, self)._create_returns()
  File "/home/odoo_14/server/addons/stock_account/wizard/stock_picking_return.py", line 18, in _create_returns
    new_picking_id, pick_type_id = super(StockReturnPicking, self)._create_returns()
  File "/home/odoo_14/server/addons/stock/wizard/stock_picking_return.py", line 120, in _create_returns
    new_picking = self.picking_id.copy({
  File "/home/odoo_14/server/odoo/models.py", line 4691, in copy
    self.ensure_one()
  File "/home/odoo_14/server/odoo/models.py", line 5028, in ensure_one
    raise ValueError("Expected singleton: %s" % self)
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/odoo_14/server/odoo/http.py", line 641, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo_14/server/odoo/http.py", line 317, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Expected singleton: stock.picking()

@legalsylvain
Copy link
Contributor

Hi. Did you tried to cherry picked that V12 patch ?
#481

if it works, could you make a PR ?

than,ks !

@DorianMAG
Copy link
Contributor

Hi @JulienMartinez , @legalsylvain .

I was able to reproduce the problem on the runboat .

Regards

@flotho
Copy link
Member

flotho commented Mar 1, 2023

Hi @JulienMartinez @DorianMAG , could you please propose a PR if it's working ?
Regards

@anmarmo1
Copy link
Contributor

The error is reproduced in runboat if the "real time" checkbox in the "Inventory management" section is activated, otherwise it works correctly

image

@chienandalu
Copy link
Member

This is addressed here #981

@zamberjo
Copy link
Member

zamberjo commented May 4, 2023

This issue is resolved, it can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants