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

Module: In-App Purchase

Entity: iap.account

Compute Method: _compute_balance

View 17.0 View 20.0
Inputs Method Outputs
  • account_info_id
  • account_info_id.balance
  • account_info_id.unit_name
  • balance_amount
  • service_id
  • service_id.integer_balance
  • service_id.unit_name
for account in self:
-             account.balance = f'{account.account_info_id.balance} {account.account_info_id.unit_name}' if account.account_info_id else "0 Credits"
+             balance_amount = round(account.balance_amount, None if account.service_id.integer_balance else 4)
+             account.balance = f"{balance_amount} {account.service_id.unit_name or ''}"
  • balance

Back to entity