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

Module: Italy - E-invoicing

Entity: account.move

Compute Method: _compute_l10n_it_payment_method

View 20.0
Inputs Method Outputs
  • preferred_payment_method_line_id
  • preferred_payment_method_line_id.l10n_it_payment_method
  • partner_id
  • partner_id.property_inbound_payment_method_line_id
  • partner_id.property_inbound_payment_method_line_id.l10n_it_payment_method
+ italian_moves = self.filtered(lambda move: move.country_code == 'IT')
+ sale_documents = italian_moves.filtered(lambda move: move.is_sale_document())
+ (italian_moves - sale_documents).l10n_it_payment_method = 'MP05'
+ for move in sale_documents:
+             move.l10n_it_payment_method = (
+                 move.preferred_payment_method_line_id.l10n_it_payment_method
+                 # Fallback to partner's configured details if they manually cleared preferred_payment_method_line_id
+                 or move.partner_id.property_inbound_payment_method_line_id.l10n_it_payment_method
+                 or 'MP05'
+             )
  • l10n_it_payment_method

Back to entity