<field name="num1"/>
<field name="num2"/>
<!-- result-->
<field name="result" sum="(num1 + num2)"/>
It is not working, is there any way to solved this simple problem?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
<field name="num1"/>
<field name="num2"/>
<!-- result-->
<field name="result" sum="(num1 + num2)"/>
It is not working, is there any way to solved this simple problem?
Hi,
You can use onchange your python file
eg:
num1 = fields.Float"Num1")
num2= fields.Float("Num2")
result = fields.Float(" Result")
api.onchange('num1','num2')
def onchange_function(self):
self.result = self.num1+self.num2in your xml,<field name="result"/>Thanks !!!
Aswini @ iWesabe
You can not sum diffrent fields values in xml file. You can create a new field in same module as computed to sum values and store it. Then you can show that field in xml view.
You can also use on_change decorater for doing sum calculation and assign value in new field.
Hello Jonart,
Check this answer : https://stackoverflow.com/questions/29853506/addsum-two-values-in-odoo
Thanks
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up