mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 13:22:05 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
4
odoo-bringout-oca-ocb-l10n_hu/l10n_hu/models/__init__.py
Normal file
4
odoo-bringout-oca-ocb-l10n_hu/l10n_hu/models/__init__.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import template_hu
|
||||
from . import account_move
|
||||
from . import res_partner
|
||||
22
odoo-bringout-oca-ocb-l10n_hu/l10n_hu/models/account_move.py
Normal file
22
odoo-bringout-oca-ocb-l10n_hu/l10n_hu/models/account_move.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
@api.depends('country_code', 'move_type')
|
||||
def _compute_show_delivery_date(self):
|
||||
# EXTENDS 'account'
|
||||
super()._compute_show_delivery_date()
|
||||
for move in self:
|
||||
if move.country_code == 'HU':
|
||||
move.show_delivery_date = move.is_sale_document()
|
||||
|
||||
def _post(self, soft=True):
|
||||
res = super()._post(soft)
|
||||
for move in self:
|
||||
if move.country_code == 'HU' and move.is_sale_document() and not move.delivery_date:
|
||||
move.delivery_date = move.invoice_date
|
||||
return res
|
||||
15
odoo-bringout-oca-ocb-l10n_hu/l10n_hu/models/res_partner.py
Normal file
15
odoo-bringout-oca-ocb-l10n_hu/l10n_hu/models/res_partner.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
l10n_hu_eu_vat = fields.Char(compute='_compute_l10n_hu_eu_vat')
|
||||
|
||||
@api.depends('vat')
|
||||
def _compute_l10n_hu_eu_vat(self):
|
||||
for partner in self:
|
||||
if partner.country_code == 'HU' and partner.vat:
|
||||
partner.l10n_hu_eu_vat = partner._convert_hu_local_to_eu_vat(partner.vat)
|
||||
else:
|
||||
partner.l10n_hu_eu_vat = False
|
||||
43
odoo-bringout-oca-ocb-l10n_hu/l10n_hu/models/template_hu.py
Normal file
43
odoo-bringout-oca-ocb-l10n_hu/l10n_hu/models/template_hu.py
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# 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('hu')
|
||||
def _get_hu_template_data(self):
|
||||
return {
|
||||
'property_account_receivable_id': 'l10n_hu_311',
|
||||
'property_account_payable_id': 'l10n_hu_454',
|
||||
'code_digits': '6',
|
||||
}
|
||||
|
||||
@template('hu', 'res.company')
|
||||
def _get_hu_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'account_fiscal_country_id': 'base.hu',
|
||||
'bank_account_code_prefix': '384',
|
||||
'cash_account_code_prefix': '381',
|
||||
'transfer_account_code_prefix': '389',
|
||||
'income_currency_exchange_account_id': 'l10n_hu_976',
|
||||
'expense_currency_exchange_account_id': 'l10n_hu_876',
|
||||
'account_sale_tax_id': 'F27',
|
||||
'account_purchase_tax_id': 'V27',
|
||||
'expense_account_id': 'l10n_hu_811',
|
||||
'income_account_id': 'l10n_hu_911',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': 'l10n_hu_211',
|
||||
},
|
||||
}
|
||||
|
||||
@template('hu', 'account.account')
|
||||
def _get_hu_account_account(self):
|
||||
return {
|
||||
'l10n_hu_211': {
|
||||
'account_stock_expense_id': 'l10n_hu_5111',
|
||||
'account_stock_variation_id': 'l10n_hu_581',
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue