Debian Codegraph @

addons/l10n_hu_edi/models/account_tax.py

raw
1 # Part of Odoo. See LICENSE file for full copyright and licensing details.
2
3 from odoo import api, fields, models
4 from odoo.tools.translate import LazyTranslate
5
6 _lt = LazyTranslate(__name__)
7
8
9 _SELECTION_TAX_TYPE = [
10 ('VAT', 'Normal VAT (percent based)'),
11 ('AAM', 'AAM - Personal tax exemption'),
12 ('TAM', 'TAM - tax-exempt activity or tax-exempt due to being in public interest or special in nature'),
13 ('KBAET', 'KBAET - intra-Community exempt supply, without new means of transport'),
14 ('KBAUK', 'KBAUK - tax-exempt, intra-Community sales of new means of transport'),
15 ('EAM', 'EAM - tax-exempt, extra-Community sales of goods (export of goods to a non-EU country)'),
16 ('NAM', 'NAM - tax-exempt on other grounds related to international transactions'),
17 ('ATK', 'ATK - Outside the scope of VAT'),
18 ('EUFAD37', 'EUFAD37 - Based on section 37 of the VAT Act, a reverse charge transaction carried out in another Member State'),
19 ('EUFADE', 'EUFADE - Reverse charge transaction carried out in another Member State, not subject to Section 37 of the VAT Act'),
20 ('EUE', 'EUE - Non-reverse charge transaction performed in another Member State'),
21 ('HO', 'HO - Transaction in a third country'),
22 ('DOMESTIC_REVERSE', 'DOMESTIC_REVERSE - Domestic reverse-charge regime'),
23 ('TRAVEL_AGENCY', 'TRAVEL_AGENCY - Profit-margin based regime for travel agencies'),
24 ('SECOND_HAND', 'SECOND_HAND - Profit-margin based regime for second-hand sales'),
25 ('ARTWORK', 'ARTWORK - Profit-margin based regime for artwork sales'),
26 ('ANTIQUES', 'ANTIQUES - Profit-margin based regime for antique sales'),
27 ('REFUNDABLE_VAT', 'REFUNDABLE_VAT - VAT incurred under sections 11 or 14, without an agreement from the beneficiary to reimburse VAT'),
28 ('NONREFUNDABLE_VAT', 'NONREFUNDABLE_VAT - VAT incurred under sections 11 or 14, with an agreement from the beneficiary to reimburse VAT'),
29 ('NO_VAT', 'VAT not applicable pursuant to section 17 of the VAT Act'),
30 ]
31
32 _DEFAULT_TAX_REASONS = {
33 'AAM': _lt('AAM Tax exempt'),
34 'TAM': _lt('TAM Exempt property'),
35 'KBAET': _lt('KBAET sale to EU - VAT tv.§ 89.'),
36 'KBAUK': _lt('KBAUK New means of transport within the EU - VAT tv.§ 89.§(2)'),
37 'EAM': _lt('EAM Product export to 3rd country - VAT tv.98-109.§'),
38 'NAM': _lt('NAM other export transaction VAT law § 110-118'),
39 'ATK': _lt('ATK Outside the scope of VAT - VAT tv.2-3.§'),
40 'EUFAD37': _lt('EUFAD37 § 37 (1) Reverse VAT in another EU country'),
41 'EUFADE': _lt('EUFADE Reverse charge of VAT in another EU country not VAT tv. § 37 (1)'),
42 'EUE': _lt('EUE Sales made in a 2nd EU country'),
43 'HO': _lt('HO Service to 3rd country'),
44 }
45
46
47 class AccountTax(models.Model):
48 _inherit = 'account.tax'
49
50 l10n_hu_tax_type = fields.Selection(
51 _SELECTION_TAX_TYPE,
52 string='NAV VAT Tax Type',
53 help='Precise identification of the VAT tax for the Hungarian authority.',
54 )
55 l10n_hu_tax_reason = fields.Char(
56 string='NAV VAT Tax Exemption Reason',
57 help='May be used to provide support for the use of a VAT-exempt VAT tax type.',
58 compute='_compute_l10n_hu_tax_reason',
59 readonly=False,
60 )
61
62 @api.depends('l10n_hu_tax_type')
63 def _compute_l10n_hu_tax_reason(self):
64 for tax in self:
65 reason = _DEFAULT_TAX_REASONS.get(tax.l10n_hu_tax_type, '')
66 tax.l10n_hu_tax_reason = self.env._(reason) # pylint: disable=gettext-variable