Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
10096 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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.


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
paź 16
3660
1
paź 19
2466
3
maj 16
5260
1
wrz 15
3468
3
kwi 25
3831