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

Module: Spain - Accounting (PGCE 2008)

Entity: account.move

Compute Method: _compute_l10n_es_is_simplified

Inputs Method Outputs
  • currency_id
  • company_id
  • company_id.currency_id
  • country_code
  • partner_id
  • move_type
  • commercial_partner_id
  • commercial_partner_id.vat
  • amount_total_signed
  • company_id.l10n_es_simplified_invoice_limit
  • commercial_partner_id.country_id
  • reversed_entry_id
  • reversed_entry_id.l10n_es_is_simplified
simplified_partner = self.env.ref('l10n_es.partner_simplified', raise_if_not_found=False)
for move in self:
            currency_id = move.currency_id or move.company_id.currency_id
            move.l10n_es_is_simplified = (move.country_code == 'ES') and (
                (not move.partner_id and move.move_type in ('in_receipt', 'out_receipt'))
                or (simplified_partner and move.partner_id == simplified_partner)
                or (move.move_type in ('out_invoice', 'out_refund')
                    and not move.commercial_partner_id.vat
                    and currency_id.compare_amounts(abs(move.amount_total_signed), move.company_id.l10n_es_simplified_invoice_limit) <= 0
                    and move.commercial_partner_id.country_id in self.env.ref('base.europe').country_ids
                )
                or move.reversed_entry_id.l10n_es_is_simplified
            )

Back to entity