Odoo Technical

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Compute method Explanation

Avatar
Mohanraj
Avatar
Discard
1 Answer
1
Avatar
Kuralarasan
Best Answer

When you enter the amount is 2000. Total field is automatically updated to 1000.

total = fields.Float(compute="_compute_total")

amount = fields.Float()

@api.depends("amount")

def _compute_total(self):

for record in self:

record.total =  record.amount / 2.0

Avatar
Discard