diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/l10n_id_efaktur/models/res_partner.py | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/l10n_id_efaktur/models/res_partner.py')
| -rw-r--r-- | addons/l10n_id_efaktur/models/res_partner.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/addons/l10n_id_efaktur/models/res_partner.py b/addons/l10n_id_efaktur/models/res_partner.py new file mode 100644 index 00000000..96f7c9c1 --- /dev/null +++ b/addons/l10n_id_efaktur/models/res_partner.py @@ -0,0 +1,37 @@ +# -*- encoding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import fields, models, api + + +class ResPartner(models.Model): + """Inherit res.partner object to add NPWP field and Kode Transaksi""" + _inherit = "res.partner" + + country_code = fields.Char(related='country_id.code', string='Country Code') + l10n_id_pkp = fields.Boolean(string="ID PKP", compute='_compute_l10n_id_pkp', store=True, readonly=False) + l10n_id_nik = fields.Char(string='NIK') + l10n_id_tax_address = fields.Char('Tax Address') + l10n_id_tax_name = fields.Char('Tax Name') + l10n_id_kode_transaksi = fields.Selection([ + ('01', '01 Kepada Pihak yang Bukan Pemungut PPN (Customer Biasa)'), + ('02', '02 Kepada Pemungut Bendaharawan (Dinas Kepemerintahan)'), + ('03', '03 Kepada Pemungut Selain Bendaharawan (BUMN)'), + ('04', '04 DPP Nilai Lain (PPN 1%)'), + ('06', '06 Penyerahan Lainnya (Turis Asing)'), + ('07', '07 Penyerahan yang PPN-nya Tidak Dipungut (Kawasan Ekonomi Khusus/ Batam)'), + ('08', '08 Penyerahan yang PPN-nya Dibebaskan (Impor Barang Tertentu)'), + ('09', '09 Penyerahan Aktiva ( Pasal 16D UU PPN )'), + ], string='Kode Transaksi', help='Dua digit pertama nomor pajak') + + @api.depends('vat', 'country_code') + def _compute_l10n_id_pkp(self): + for record in self: + record.l10n_id_pkp = record.vat and record.country_code == 'ID' + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + l10n_id_tax_address = fields.Char('Tax Address', related='company_id.partner_id.l10n_id_tax_address', readonly=False) + l10n_id_tax_name = fields.Char('Tax Name', related='company_id.partner_id.l10n_id_tax_address', readonly=False) |
