19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:34 +01:00
parent c5006a6999
commit 80293571e7
420 changed files with 21812 additions and 44297 deletions

View file

@ -1,2 +1,3 @@
from . import account_chart_template
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import template_eg
from . import account_tax

View file

@ -1,17 +0,0 @@
from odoo import models
class AccountChartTemplate(models.Model):
_inherit = 'account.chart.template'
def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):
""" If EGYPT chart, we add 2 new journals TA and IFRS"""
if self == self.env.ref('l10n_eg.egypt_chart_template_standard'):
if not journals_dict:
journals_dict = []
journals_dict.extend(
[{"name": "Tax Adjustments", "company_id": company.id, "code": "TA", "type": "general", "sequence": 1,
"favorite": True},
{"name": "IFRS 16", "company_id": company.id, "code": "IFRS", "type": "general", "favorite": True,
"sequence": 10}])
return super()._prepare_all_journals(acc_template_ref, company, journals_dict=journals_dict)

View file

@ -1,8 +1,8 @@
from odoo import models, fields
class ETAAccountTaxMixin(models.AbstractModel):
_name = 'l10n_eg.eta.account.tax.mixin'
class AccountTax(models.Model):
_inherit = 'account.tax'
_description = 'ETA tax codes mixin'
l10n_eg_eta_code = fields.Selection(
@ -65,20 +65,3 @@ class ETAAccountTaxMixin(models.AbstractModel):
('t20_of04', 'T20 - OF04 - Other fees (amount)')
],
string='ETA Code (Egypt)', default=False)
class AccountTax(models.Model):
_name = 'account.tax'
_inherit = ['account.tax', 'l10n_eg.eta.account.tax.mixin']
class AccountTaxTemplate(models.Model):
_name = 'account.tax.template'
_inherit = ['account.tax.template', 'l10n_eg.eta.account.tax.mixin']
def _get_tax_vals(self, company, tax_template_to_tax):
vals = super(AccountTaxTemplate, self)._get_tax_vals(company, tax_template_to_tax)
vals.update({
'l10n_eg_eta_code': self.l10n_eg_eta_code,
})
return vals

View file

@ -0,0 +1,70 @@
# 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('eg')
def _get_eg_template_data(self):
return {
'code_digits': '6',
'property_account_receivable_id': 'egy_account_102011',
'property_account_payable_id': 'egy_account_201002',
}
@template('eg', 'res.company')
def _get_eg_res_company(self):
return {
self.env.company.id: {
'account_fiscal_country_id': 'base.eg',
'bank_account_code_prefix': '101',
'cash_account_code_prefix': '105',
'transfer_account_code_prefix': '100',
'account_default_pos_receivable_account_id': 'egy_account_102012',
'income_currency_exchange_account_id': 'egy_account_500011',
'expense_currency_exchange_account_id': 'egy_account_400053',
'account_journal_suspense_account_id': 'egy_account_201001',
'account_journal_early_pay_discount_loss_account_id': 'egy_account_400079',
'account_journal_early_pay_discount_gain_account_id': 'egy_account_500014',
'default_cash_difference_income_account_id': 'egy_account_999002',
'default_cash_difference_expense_account_id': 'egy_account_999001',
'account_sale_tax_id': 'eg_standard_sale_14',
'account_purchase_tax_id': 'eg_standard_purchase_14',
'expense_account_id': 'egy_account_400028',
'income_account_id': 'egy_account_500001',
'tax_calculation_rounding_method': 'round_per_line',
'account_stock_journal_id': 'inventory_valuation',
'account_stock_valuation_id': 'egy_account_132100',
},
}
@template('eg', 'account.journal')
def _get_eg_account_journal(self):
""" If EGYPT chart, we add 2 new journals TA and IFRS"""
return {
"tax_adjustment": {
"name": "Tax Adjustments",
"code": "TA",
"type": "general",
"sequence": 10,
"show_on_dashboard": True,
},
"ifrs": {
"name": "IFRS 16",
"code": "IFRS",
"type": "general",
"show_on_dashboard": True,
"sequence": 11,
},
}
@template('eg', 'account.account')
def _get_eg_account_account(self):
return {
'egy_account_132100': {
'account_stock_expense_id': 'egy_account_400080',
'account_stock_variation_id': 'egy_account_400036',
},
}