mirror of
https://github.com/bringout/oca-ocb-l10n_me-africa.git
synced 2026-04-28 05:42:08 +02:00
19.0 vanilla
This commit is contained in:
parent
c5006a6999
commit
80293571e7
420 changed files with 21812 additions and 44297 deletions
6
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/__init__.py
Normal file
6
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/__init__.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import template_ke
|
||||
from . import l10n_ke_item_code
|
||||
from . import account_tax
|
||||
from . import account_move
|
||||
from . import res_company
|
||||
14
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/account_move.py
Normal file
14
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/account_move.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
l10n_ke_wh_certificate_number = fields.Char(
|
||||
string="Withholding Certificate Number",
|
||||
help="Customer withholding certificate number",
|
||||
)
|
||||
|
||||
l10n_ke_wh_certificate_date = fields.Date(
|
||||
string="Date of Certificate",
|
||||
)
|
||||
19
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/account_tax.py
Normal file
19
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/account_tax.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class AccountTax(models.Model):
|
||||
_inherit = 'account.tax'
|
||||
|
||||
l10n_ke_item_code_id = fields.Many2one(
|
||||
'l10n_ke.item.code',
|
||||
string='KRA Item Code',
|
||||
help='KRA code that describes a tax rate or exemption on specific products or services.',
|
||||
)
|
||||
|
||||
@api.onchange('amount')
|
||||
def _onchange_l10n_ke_item_code_id(self):
|
||||
""" When the amount of the tax changes this field is reset """
|
||||
for tax in self:
|
||||
if tax._origin.amount != tax.amount:
|
||||
tax.l10n_ke_item_code_id = None
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class L10n_KeItemCode(models.Model):
|
||||
_name = 'l10n_ke.item.code'
|
||||
_description = "KRA defined codes that justify a given tax rate / exemption"
|
||||
_rec_names_search = ['code', 'description']
|
||||
|
||||
code = fields.Char(string='KRA Item Code')
|
||||
description = fields.Char(string='Description')
|
||||
tax_rate = fields.Selection([('C', 'Zero Rated'), ('E', 'Exempted'), ('B', 'Taxable at 8%')])
|
||||
|
||||
@api.depends('code', 'description')
|
||||
def _compute_display_name(self):
|
||||
for item_code in self:
|
||||
item_code.display_name = f'{item_code.code} {item_code.description}'
|
||||
18
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/res_company.py
Normal file
18
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/res_company.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
l10n_ke_oscu_is_active = fields.Boolean(
|
||||
string="Is OSCU active?",
|
||||
help="Whether this company is set up for OSCU flows.",
|
||||
compute='_compute_l10n_ke_oscu_is_active',
|
||||
)
|
||||
|
||||
def _compute_l10n_ke_oscu_is_active(self):
|
||||
""" Overridden in enterprise when the OSCU module is used in the company"""
|
||||
self.l10n_ke_oscu_is_active = False
|
||||
51
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/template_ke.py
Normal file
51
odoo-bringout-oca-ocb-l10n_ke/l10n_ke/models/template_ke.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# 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('ke')
|
||||
def _get_ke_template_data(self):
|
||||
return {
|
||||
'property_account_receivable_id': 'ke1100',
|
||||
'property_account_payable_id': 'ke2100',
|
||||
'property_stock_valuation_account_id': 'ke1001',
|
||||
'code_digits': '6',
|
||||
}
|
||||
|
||||
@template('ke', 'res.company')
|
||||
def _get_ke_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'anglo_saxon_accounting': True,
|
||||
'account_fiscal_country_id': 'base.ke',
|
||||
'bank_account_code_prefix': '12000',
|
||||
'cash_account_code_prefix': '12500',
|
||||
'transfer_account_code_prefix': '12100',
|
||||
'account_default_pos_receivable_account_id': 'ke110010',
|
||||
'income_currency_exchange_account_id': 'ke5144',
|
||||
'expense_currency_exchange_account_id': 'ke5144',
|
||||
'account_journal_early_pay_discount_loss_account_id': 'ke5147',
|
||||
'account_journal_early_pay_discount_gain_account_id': 'ke400710',
|
||||
'default_cash_difference_income_account_id': 'ke5146',
|
||||
'default_cash_difference_expense_account_id': 'ke5146',
|
||||
'account_sale_tax_id': 'ST16',
|
||||
'account_purchase_tax_id': 'PT16',
|
||||
'tax_exigibility': 'True',
|
||||
'expense_account_id': 'ke5001',
|
||||
'income_account_id': 'ke4001',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': 'ke1001',
|
||||
},
|
||||
}
|
||||
|
||||
@template('ke', 'account.account')
|
||||
def _get_ke_account_account(self):
|
||||
return {
|
||||
'ke1001': {
|
||||
'account_stock_expense_id': 'ke5001',
|
||||
'account_stock_variation_id': 'ke500105',
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue