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

When i try to create a dashboard like this:
model: Sale.order
operation: sum

measured field: total
group by: seller (user_id)


I get this error:

Traceback (most recent call last):
  File "/opt/odoo18/odoo/http.py", line 1957, in _transactioning
    return service_model.retrying(func, env=self.env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo18/odoo/service/model.py", line 137, in retrying
    result = func()
             ^^^^^^
  File "/opt/odoo18/odoo/http.py", line 1924, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo18/odoo/http.py", line 2171, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^
  File "/opt/odoo18/odoo/addons/base/models/ir_http.py", line 329, in _dispatch
    result = endpoint(**request.params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo18/odoo/http.py", line 727, in route_wrapper
    result = endpoint(self, *args, **params_ok)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo18/addons/web/controllers/dataset.py", line 35, in call_kw
    return call_kw(request.env[model], method, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo18/odoo/api.py", line 517, in call_kw
    result = getattr(recs, name)(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo18/custom/addons/odoo_dynamic_dashboard/models/dashboard_block.py", line 126, in get_dashboard_vals
    self._cr.execute(self.env[rec.model_name].get_query(domain,
  File "/opt/odoo18/odoo/sql_db.py", line 354, in execute
    res = self._obj.execute(query, params)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.errors.UndefinedColumn: column res_users.name does not exist
LINE 1: ...ALESCE(SUM("sale_order".amount_total),0) AS value,"res_users...

Seems like the error comes from a query on the database, this doesn't happen for every selectable field on 'group by', just by some like the seller field.

아바타
취소
베스트 답변

Hi,
Not sure if you use any existing functionalities or custom solution, the error says that there is no field name in the model res_users, instead you have to left join the query with res_partner table and get the name from partner table.

Thanks

아바타
취소
관련 게시물 답글 화면 활동
1
8월 25
145
1
8월 25
300
4
7월 25
1634
1
7월 25
923
2
7월 25
939