我正在尝试在plan_payment_number
时在树视图中计算group_by
,但是在Odoo v8中默认为SUM。我只需要数plan_payment_number
。
这就是我现在拥有的:
这就是我所需要的:
我尝试了count = "true"
。我在树状视图上的代码:
<record id="view_plan_car_tree" model="ir.ui.view">
<field name="name">plan.car.tree</field>
<field name="model">plan.car</field>
<field name="arch" type="xml">
<tree colors="blue:state == 'draft';black:state ==
'done';gray:state == 'cancel'" string="Payments">
<field name="number"/>
<field name="plan_payment_number" />
<field name="date_to"/>
<field name="name"/>
<field name="state"/>
<field name="contract_id"/>
<field name="partner_id"/>
<field name="initial_quota"/>
<field name="capital_quota"/>
<field name="administrative_quota"/>
<field name="pay_type"/>
<field name="company_id" groups="base.group_multi_company"
widget="selection"/>
<field name="plan_run_id" invisible="1"/>
</tree>
</field>
</record>
答案 0 :(得分:0)
我对这个问题的解决方案是:
raise TypeError('tensor is not a torch image.')
TypeError: tensor is not a torch image.