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

Module: Malaysia - E-invoicing

Entity: account.move.line

Compute Method: _compute_l10n_my_edi_classification_code

Inputs Method Outputs
  • move_id
  • move_id.l10n_my_edi_state
  • is_downpayment
  • product_id
  • product_id.product_tmpl_id
  • product_id.product_tmpl_id.l10n_my_edi_classification_code
  • l10n_my_edi_classification_code
""" Default to the product classification if any """
for line in self:
            # We don't want to automatically update it on invoices that were sent to MyInvois
            if not line.move_id.l10n_my_edi_state:
                # There is no product in case of downpayments, so we need to manually set the class code
                if 'is_downpayment' in line and line.is_downpayment:
                    line.l10n_my_edi_classification_code = "022"
                else:
                    line.l10n_my_edi_classification_code = line.product_id.product_tmpl_id.l10n_my_edi_classification_code or line.l10n_my_edi_classification_code

Back to entity