跳至内容
菜单
此问题已终结
78 查看

My goal is to show the not invoiced amount of salesorders grouped by delivery date with a graph.


for this i created a custom field (type float, since we invoice in EUR and CHF and i dont want to mess around with currency problems and for forecasting is this ok) which gets calculated like this:

for record in self:

    record['x_offener_betrag_calc'] = record.amount_total - record.amount_invoiced


the field works properly, i also can aggregate it in lists with sum. but somehow i cant use it in the diagram view. two problems here:

1. i cant select the field in the "values" list and dont find any possibilit to bring it there.

2. if i add filter and adjust the context manually like this:


{'group_by': ['commitment_date:month', 'partner_id'], 'graph_measure': 'x_offener_betrag_calc', 'graph_mode': 'bar', 'graph_groupbys': ['commitment_date:month', 'partner_id'], 'graph_order': None, 'graph_stacked': True}


then i get the following error when applying the filter:


Uncaught Promise > No aggregate function has been provided for the measure 'x_offener_betrag_calc'


has anybody an idea how to make that work?


形象
丢弃
相关帖文 回复 查看 活动
1
6月 25
99
1
6月 25
87
0
6月 25
66
0
6月 25
67
0
6月 25
117