Sales - Reporting - Sales: psycopg2.DataError: division by zero

Sales - Reporting - Sales: psycopg2.DataError: division by zero

当我点击“销售”->“报告”菜单下的“销售”菜单时,收到以下错误消息:

Error: Odoo Server Error

Traceback (most recent call last): File "/data/odoo/odoo/odoo/http.py", line 650, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/data/odoo/odoo/odoo/http.py", line 310, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "/data/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise raise value File "/data/odoo/odoo/odoo/http.py", line 692, in dispatch result = self._call_function(**self.params) File "/data/odoo/odoo/odoo/http.py", line 342, in _call_function return checked_call(self.db, *args, **kwargs) File "/data/odoo/odoo/odoo/service/model.py", line 97, in wrapper return f(dbname, *args, **kwargs) File "/data/odoo/odoo/odoo/http.py", line 335, in checked_call result = self.endpoint(*a, **kw) File "/data/odoo/odoo/odoo/http.py", line 936, in call return self.method(*args, **kw) File "/data/odoo/odoo/odoo/http.py", line 515, in response_wrap response = f(*args, **kw) File "/data/odoo/odoo/addons/web/controllers/main.py", line 934, in call_kw return self._call_kw(model, method, args, kwargs) File "/data/odoo/odoo/addons/web/controllers/main.py", line 926, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/data/odoo/odoo/odoo/api.py", line 687, in call_kw return call_kw_model(method, model, args, kwargs) File "/data/odoo/odoo/odoo/api.py", line 672, in call_kw_model result = method(recs, *args, **kwargs) File "/data/odoo/odoo/odoo/models.py", line 1908, in read_group result = self._read_group_raw(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy) File "/data/odoo/odoo/odoo/models.py", line 1998, in _read_group_raw self._cr.execute(query, where_clause_params) File "/data/odoo/odoo/odoo/sql_db.py", line 155, in wrapper return f(self, *args, **kwargs) File "/data/odoo/odoo/odoo/sql_db.py", line 232, in execute res = self._obj.execute(query, params) psycopg2.DataError: division by zero

还有其他人遇到过这个问题吗?

似乎你有一些奇怪的数据让 postgres 做一些除零。如果您谈论的是 sale.report,我的第一个猜测是:您正在使用 factor == 0 的某些度量单位。

sum(p.weight * l.product_uom_qty / u.factor * u2.factor) as weight,
sum(p.volume * l.product_uom_qty / u.factor * u2.factor) as volume

货币是我的第二个猜测。您是否检查了每家公司的所有费率? 2018 年 12 月也有 Odoo 11 的提交,修复了零汇率问题。所以你也可以尝试使用最新的Odoo版本并更新sale