Edi Santoso
Odoo and Python Developer
drink a tea to enjoying the life

odoo error ketika inherit _amount_all function

Pernah alami error ? yeah saya juga :3

ini asil dari googling, and wow its work well for me :D


Ok thanks for the example. Indeed this scenario should be covered, sorry about that.
However I just made a quick test and it worked fine
class PO(models.Model):
    _inherit = 'purchase.order'

    additional_fee = fields.Float()

    @api.depends('additional_fee')
    def _amount_all(self):
        super(PO, self)._amount_all()
        for order in self:
            order.amount_total += order.additional_fee
(only the new trigger is needed as it's concatenated)
The amount_total field was correctly recomputed when either order_line.price_total oradditional_fee was modified.


:)