-
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
|
|