콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
2089 화면

I am trying to migrate our custom_module to Odoo 15 code. This custom module works with DOM and has to read an xml file. But everytime I press on read file Iget this kind of error. On Odoo13 it worked fine but on 15 not anymore: 





Odoo Server Error

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 687, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 348, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 916, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 535, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1339, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1327, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 464, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 451, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/Odoo/Custom_Addon/modul-x_invoice-master/models/x_invoice.py", line 599, in read_file
    self.name = self.get_file_name()
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1217, in __set__
    records.write({self.name: write_value})
  File "/opt/Odoo/Custom_Addon/modul-x_invoice-master/models/x_invoice.py", line 654, in write
    self.write_file()
  File "/opt/Odoo/Custom_Addon/modul-x_invoice-master/models/x_invoice.py", line 606, in write_file
    self.set_xml_data()
  File "/opt/Odoo/Custom_Addon/modul-x_invoice-master/models/x_invoice.py", line 413, in set_xml_data
    self.domtree = self.get_xml_domtree()
Exception

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

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
AttributeError: 'x.invoice' object attribute 'domtree' is read-only


아바타
취소
작성자 베스트 답변

Hallo,

stellen Sie sicher, dass Sie versuchen, in einer anderen Funktion erneut auf self.domtree zuzugreifen. Dies war das Problem, das ich hatte, und ich konnte es lösen, indem ich nur einmal versuchte, auf Domtree zuzugreifen.

아바타
취소
베스트 답변

We are facing a similar issue - did you get a solution?


아바타
취소
관련 게시물 답글 화면 활동
0
4월 22
1963
0
9월 22
3126
0
11월 23
1210
2
12월 23
12698
1
11월 22
3670