v14-facturacionelectronica/l10n_co_stock_e_invoicing/models/account_incoterms.py

23 lines
586 B
Python

# -*- coding: utf-8 -*-
# Copyright 2021 Joan Marín <Github@JoanMarin>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountIncoterms(models.Model):
_inherit = "account.incoterms"
is_einvoicing = fields.Boolean(string="Does it Apply for E-Invoicing?")
def name_get(self):
res = []
for record in self:
if record.is_einvoicing:
name = u'[DIAN][%s] %s' % (record.code or '', record.name or '')
else:
name = u'[%s] %s' % (record.code or '', record.name or '')
res.append((record.id, name))
return res