mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-26 22:02:04 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
8
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/__init__.py
Normal file
8
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/__init__.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import product
|
||||
from . import account_move
|
||||
from . import res_partner
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
from . import l10n_pl_tax_office
|
||||
from . import template_pl
|
||||
42
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/account_move.py
Normal file
42
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/account_move.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
l10n_pl_vat_b_spv = fields.Boolean(
|
||||
string='B_SPV',
|
||||
help="Transfer of a single-purpose voucher effected by a taxable person acting on his/its own behalf",
|
||||
)
|
||||
l10n_pl_vat_b_spv_dostawa = fields.Boolean(
|
||||
string='B_SPV_Dostawa',
|
||||
help="Supply of goods and/or services covered by a single-purpose voucher to a taxpayer",
|
||||
)
|
||||
l10n_pl_vat_b_mpv_prowizja = fields.Boolean(
|
||||
string='B_MPV_Prowizja',
|
||||
help="Supply of agency and other services pertaining to the transfer of a single-purpose voucher",
|
||||
)
|
||||
|
||||
@api.depends('country_code')
|
||||
def _compute_show_taxable_supply_date(self):
|
||||
super()._compute_show_taxable_supply_date()
|
||||
for move in self.filtered(lambda m: m.country_code == 'PL' and m.move_type != 'entry' and (m.state == 'draft' or m.taxable_supply_date)):
|
||||
move.show_taxable_supply_date = True
|
||||
|
||||
@api.depends('country_code')
|
||||
def _compute_taxable_supply_date_placeholder(self):
|
||||
super()._compute_taxable_supply_date_placeholder()
|
||||
for move in self.filtered(lambda m: m.country_code == 'PL'):
|
||||
move.taxable_supply_date_placeholder = self.env._("Invoice Date")
|
||||
|
||||
def _get_accounting_date_source(self):
|
||||
self.ensure_one()
|
||||
if self.country_code == 'PL' and self.taxable_supply_date:
|
||||
return self.taxable_supply_date
|
||||
return super()._get_accounting_date_source()
|
||||
|
||||
def _get_invoice_currency_rate_date(self):
|
||||
self.ensure_one()
|
||||
if self.country_code == 'PL' and self.taxable_supply_date:
|
||||
return self.taxable_supply_date
|
||||
return super()._get_invoice_currency_rate_date()
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class L10n_PlL10n_Pl_Tax_Office(models.Model):
|
||||
_name = 'l10n_pl.l10n_pl_tax_office'
|
||||
_description = 'Tax Office in Poland'
|
||||
_rec_names_search = ['name', 'code']
|
||||
_order = 'code'
|
||||
|
||||
code = fields.Char('Code', required=True)
|
||||
name = fields.Char('Description', required=True)
|
||||
|
||||
_code_company_uniq = models.Constraint(
|
||||
'unique (code)',
|
||||
'The code of the tax office must be unique !',
|
||||
)
|
||||
|
||||
@api.depends('name', 'code')
|
||||
def _compute_display_name(self):
|
||||
for tax_office in self:
|
||||
tax_office.display_name = f'{tax_office.code} {tax_office.name}'
|
||||
25
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/product.py
Normal file
25
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/product.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from odoo import models, fields
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
l10n_pl_vat_gtu = fields.Selection(
|
||||
string='GTU Codes',
|
||||
selection=[
|
||||
('GTU_01', 'GTU_01 - Alcoholic beverages'),
|
||||
('GTU_02', 'GTU_02 - Goods referred to under Art. 103 sec 5aa'),
|
||||
('GTU_03', 'GTU_03 - Fuel oil for excise duty, lubricating oils and other oils'),
|
||||
('GTU_04', 'GTU_04 - Tobacco products, tobacco, e-liquid'),
|
||||
('GTU_05', 'GTU_05 - Wastes'),
|
||||
('GTU_06', 'GTU_06 - Electronic devices, their parts and materials'),
|
||||
('GTU_07', 'GTU_07 - Vehicles and vehicle parts'),
|
||||
('GTU_08', 'GTU_08 - Precious metals and base metals'),
|
||||
('GTU_09', 'GTU_09 - Medicament and medical devices, medicinal products'),
|
||||
('GTU_10', 'GTU_10 - Buildings, structures and land'),
|
||||
('GTU_11', 'GTU_11 - Services related to the greenhouse gas emission allowance trading'),
|
||||
('GTU_12', 'GTU_12 - Intangible services'),
|
||||
('GTU_13', 'GTU_13 - Transport services and warehouse management services'),
|
||||
],
|
||||
help='Codes for specific types of products, needed for VAT declaration'
|
||||
)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
l10n_pl_reports_tax_office_id = fields.Many2one('l10n_pl.l10n_pl_tax_office', string='Tax Office', groups="account.group_account_user")
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
l10n_pl_reports_tax_office_id = fields.Many2one(related='company_id.l10n_pl_reports_tax_office_id', readonly=False)
|
||||
14
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/res_partner.py
Normal file
14
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/res_partner.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# coding: utf-8
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
"""Inherited to add the information needed for the JPK"""
|
||||
_inherit = 'res.partner'
|
||||
|
||||
l10n_pl_links_with_customer = fields.Boolean(
|
||||
string='Links With Company',
|
||||
help='TP: Existing connection or influence between the customer and the supplier'
|
||||
)
|
||||
47
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/template_pl.py
Normal file
47
odoo-bringout-oca-ocb-l10n_pl/l10n_pl/models/template_pl.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models
|
||||
from odoo.addons.account.models.chart_template import template
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = 'account.chart.template'
|
||||
|
||||
@template('pl')
|
||||
def _get_pl_template_data(self):
|
||||
return {
|
||||
'property_account_receivable_id': 'chart20000100',
|
||||
'property_account_payable_id': 'chart21000100',
|
||||
'code_digits': '8',
|
||||
'use_storno_accounting': True,
|
||||
}
|
||||
|
||||
@template('pl', 'res.company')
|
||||
def _get_pl_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'account_fiscal_country_id': 'base.pl',
|
||||
'bank_account_code_prefix': '11.000.00',
|
||||
'cash_account_code_prefix': '12.000.00',
|
||||
'transfer_account_code_prefix': '11.090.00',
|
||||
'account_default_pos_receivable_account_id': 'chart20000200',
|
||||
'income_currency_exchange_account_id': 'chart75000600',
|
||||
'expense_currency_exchange_account_id': 'chart75010400',
|
||||
'account_journal_early_pay_discount_loss_account_id': 'chart75010900',
|
||||
'account_journal_early_pay_discount_gain_account_id': 'chart75000900',
|
||||
'default_cash_difference_income_account_id': 'chart75000700',
|
||||
'default_cash_difference_expense_account_id': 'chart75010500',
|
||||
'expense_account_id': 'chart70010100',
|
||||
'income_account_id': 'chart73000100',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': 'chart33000400',
|
||||
},
|
||||
}
|
||||
|
||||
@template('pl', 'account.account')
|
||||
def _get_pl_account_account(self):
|
||||
return {
|
||||
'chart33000400': {
|
||||
'account_stock_expense_id': 'chart73010100',
|
||||
'account_stock_variation_id': 'chart74010100',
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue