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

Module: Invoicing

Entity: account.analytic.line

Compute Method: _compute_analytic_profitability

View 18.0
Inputs Method Outputs
  • general_account_id
  • general_account_id.account_type
  • category
  • amount
+ for line in self:
+             account_type = line.general_account_id.account_type or ''
+             if (
+                 account_type.split('_')[0] == 'expense'
+                 or account_type in ['asset_current', 'asset_non_current', 'asset_fixed']
+                 or (not account_type and line.category not in ['invoice', 'other'])
+                 or (not account_type and line.category == 'other' and line.amount < 0)
+             ):
+                 line.analytic_profitability = 'loss'
+             elif (
+                 account_type.split('_')[0] == 'income'
+                 or (not account_type and line.category == 'other' and line.amount > 0)
+             ):
+                 line.analytic_profitability = 'revenue'
+             else:
+                 line.analytic_profitability = 'uncategorized'
  • analytic_profitability

Back to entity