I have edited the survey.answer and add a POINTS field.. What I need to do is, when a user answer a question. their is a corresponding point for that, the formula is response * points but then i need to get the sum of all answer, it means i need to have this formula * sum(response * points )* .. I dont know how to do this summation of columns in survey.answer
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
3835
Views
Hello lhadiesleo
you can use field.function() which will do the calculation at run time and print the result in your desire field.
py file class survey_answer:
def _my_point_sum():
calculate your sum here
columns={
'function' : fields.function(
_my_point_sum,
type='char',
string='Points'),
}
I already do that but it is not working, it still gets the value in the last line of the column,