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

Module: Colombia - Accounting

Entity: res.partner

Compute Method: _compute_l10n_co_dian_id

View 20.0
Inputs Method Outputs
+ """ The DIAN identification the partner is invoiced with, its preferred identifier
+         paired with the DIAN code describing which document it is."""
+ for partner in self:
+             vals = partner._get_preferred_legal_entity_identifier_vals()
+             if not vals:
+                 partner.l10n_co_dian_id_code = partner.l10n_co_dian_id_value = False
+                 continue
+             dian_code = CO_DIAN_CODES.get(vals['key'])
+             if not dian_code:
+                 if vals.get('category') not in TIN_CATEGORIES:
+                     dian_code = CO_FOREIGN_ID_DIAN_CODE
+                 elif 'CO' in (vals.get('countries') or []):
+                     dian_code = CO_NIT_DIAN_CODE
+                 else:
+                     dian_code = CO_FOREIGN_VAT_DIAN_CODE
+             partner.l10n_co_dian_id_code = dian_code
+             partner.l10n_co_dian_id_value = vals['value']
  • l10n_co_dian_id_code
  • l10n_co_dian_id_value

Back to entity