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

[12.0] Problem when creating a return to customer #236

Closed
marcgendron-dyze opened this issue Aug 26, 2021 · 3 comments
Closed

[12.0] Problem when creating a return to customer #236

marcgendron-dyze opened this issue Aug 26, 2021 · 3 comments

Comments

@marcgendron-dyze
Copy link

When I click on the button Return to customer, I choose a date, then I click on Deliver, it sends a python error. I don't understand why the date_expected is readonly. The move_form is in draft (I logged it just before the error) so It should not be read-only. Does any one had the same issue?

image

image

Odoo Server Error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 98, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 967, in call_button
    action = self._call_kw(model, method, args, {})
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 955, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 746, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/srv/rma/rma/wizard/rma_delivery.py", line 102, in action_deliver
    rma.create_return(self.scheduled_date, qty, uom)
  File "/srv/rma/rma/models/rma.py", line 1041, in create_return
    move_form, scheduled_date, qty, uom)
  File "/srv/rma/rma/models/rma.py", line 1080, in _prepare_returning_move
    move_form.date_expected = scheduled_date
  File "/usr/lib/python3/dist-packages/odoo/tests/common.py", line 1409, in __setattr__
    "can't write on readonly field {}".format(field)
AssertionError: can't write on readonly field date_expected
@chienandalu
Copy link
Member

Hi, @marcgendron-dyze . Can you reproduce the error on a runbot a give some complete steps to reproduce it?

@marcgendron-dyze
Copy link
Author

@chienandalu I just tried on the run but. It does not the error. So it must be something in conflict on my installation. I will continue ton investigate, but I'm new on odoo, and I have a hard time to understand why I get this error. The declaration in stock\model\stock_move.py seams to say that it should only be readonly if the state is Done. I verified the state and its 'draft'. If you have any cue for me, I would appreciate.

Thank you.

@pedrobaeza
Copy link
Member

Closing meanwhile there's no steps to reproduce it.

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

No branches or pull requests

3 participants