Debian Codegraph @

addons/l10n_sg_ubl_pint/models/res_partner.py

raw symbols SCIP
1 # Part of Odoo. See LICENSE file for full copyright and licensing details.
2 from odoo import models, fields
3
4
5 class ResPartner(models.Model):
6 _inherit = 'res.partner'
7
8 invoice_edi_format = fields.Selection(selection_add=[('pint_sg', "Singapore (Peppol PINT SG)")])
9
10 def _get_edi_builder(self, invoice_edi_format):
11 # EXTENDS 'account_edi_ubl_cii'
12 if invoice_edi_format == 'pint_sg':
13 return self.env['account.edi.xml.pint_sg']
14 return super()._get_edi_builder(invoice_edi_format)
15
16 def _get_ubl_cii_formats_info(self):
17 # EXTENDS 'account_edi_ubl_cii'
18 formats_info = super()._get_ubl_cii_formats_info()
19 formats_info['pint_sg'] = {'countries': ['SG'], 'on_peppol': True, 'sequence': 90} # has priority over UBL_SG from 'account_edi_ubl_cii'
20 return formats_info