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

I want to make some calculations with product data and display them in a custom table, for example: I have a list of the kind: [{'name': u'Ipad', 'percentage': 45}, {'name': u'Imac', 'percentage': 20}] , how I can show this table in a form view, maybe I can do this with Qweb templates?, any example?, thanks.

頭像
捨棄
最佳答案

You need to create an osv.osv_memory class with the structure

class my_calculation(osv.osv_memory):
_columns={
'name':fields.char('Name',),
'percentage':fields.integer('Percentage',),
}

you have to display it the same way the 'Change Password' view is shown.

Pls refer to the class 'change_password_wizard' in addons\base\res\wizard


The same data could be shown using a Qweb template, if you see them as a report data.


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
10月 16
3896
1
10月 19
2666
3
5月 16
5515
1
9月 15
3728
3
4月 25
4590