Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Argentina - Payment Withholdings

Entity: l10n_ar.earnings.scale.line

Compute Method: _compute_from_amount

View 19.0 View 20.0
Inputs Method Outputs
  • scale_id
  • scale_id.line_ids
  • to_amount
for line in self:
-             line.from_amount = line.scale_id.line_ids.sorted(reverse=True).filtered(lambda l: l.to_amount < line.to_amount)[:1].to_amount
+             # A bracket starts where the previous one ends
+             lower_brackets = line.scale_id.line_ids.filtered(lambda l: l.to_amount < line.to_amount)
+             line.from_amount = max(lower_brackets.mapped('to_amount'), default=0.0)
  • from_amount

Back to entity