I have a pivot view of budget. I added new field named 'pivot_practical_amount' to 'crossovered_budget_lines' table on db. Which is copying value of 'amount' on 'account_analytic_line'. In the list view I see practical amount value but in pivot view it's not updating itself.
I want to copy practical_amount to pivot_practical_amount everytime I open pivot view or open budget page.
I tried that @api.depends method of new odoo api.
class BudgetGraph(models.Model):
_inherit = "crossovered.budget.lines"
pivot_practical_amount = fields.Float("Practical Amount", compute="_pivot_practical_amount_compute", digits_compute=dp.get_precision('Account'), store=True)
@api.one
@api.depends('planned_amount', 'practical_amount')
def _pivot_practical_amount_compute(self):
self.pivot_practical_amount = self.practical_amount
But this time it's updating only when I edit planned_amount.
How can I update pivot_practical_amount(crossovered_budget_lines) instantly when amount(account_analytic_line) changed?