跳至內容
選單
此問題已被標幟
2 回覆
2083 瀏覽次數

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
1962
0
9月 22
3126
0
11月 23
1208
2
12月 23
12694
1
11月 22
3666