mirror of
https://github.com/bringout/oca-ocb-l10n_asia-pacific.git
synced 2026-04-26 01:01:59 +02:00
19.0 vanilla
This commit is contained in:
parent
7dc55599c6
commit
7f43bbbfcc
650 changed files with 45260 additions and 33436 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import template_ph
|
||||
from . import res_partner
|
||||
from . import account_move
|
||||
from . import account_payment
|
||||
from . import account_tax
|
||||
from . import account_tax_template
|
||||
from . import res_company
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountTaxTemplate(models.Model):
|
||||
_inherit = "account.tax.template"
|
||||
|
||||
l10n_ph_atc = fields.Char("Philippines ATC")
|
||||
|
||||
def _get_tax_vals(self, company, tax_template_to_tax):
|
||||
val = super()._get_tax_vals(company, tax_template_to_tax)
|
||||
val.update({"l10n_ph_atc": self.l10n_ph_atc})
|
||||
return val
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
branch_code = fields.Char(string='Company Branch Code', related='partner_id.branch_code')
|
||||
l10n_ph_rdo = fields.Char(related='partner_id.l10n_ph_rdo', readonly=False)
|
||||
|
|
@ -10,6 +10,7 @@ class ResPartner(models.Model):
|
|||
first_name = fields.Char("First Name")
|
||||
middle_name = fields.Char("Middle Name")
|
||||
last_name = fields.Char("Last Name")
|
||||
l10n_ph_rdo = fields.Char("RDO", help="Revenue District Office")
|
||||
|
||||
@api.model
|
||||
def _commercial_fields(self):
|
||||
|
|
@ -20,6 +21,6 @@ class ResPartner(models.Model):
|
|||
for partner in self:
|
||||
branch_code = '000'
|
||||
if partner.country_id.code == 'PH' and partner.vat:
|
||||
match = partner.__check_vat_ph_re.match(partner.vat)
|
||||
match = partner._check_vat_ph_re.match(partner.vat)
|
||||
branch_code = match and match.group(1) and match.group(1)[1:] or branch_code
|
||||
partner.branch_code = branch_code
|
||||
|
|
|
|||
56
odoo-bringout-oca-ocb-l10n_ph/l10n_ph/models/template_ph.py
Normal file
56
odoo-bringout-oca-ocb-l10n_ph/l10n_ph/models/template_ph.py
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# 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('ph')
|
||||
def _get_ph_template_data(self):
|
||||
return {
|
||||
'property_account_receivable_id': 'l10n_ph_account_110000',
|
||||
'property_account_payable_id': 'l10n_ph_account_200000',
|
||||
'property_stock_valuation_account_id': 'l10n_ph_account_110300',
|
||||
'code_digits': '6',
|
||||
}
|
||||
|
||||
@template('ph', 'res.company')
|
||||
def _get_ph_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'anglo_saxon_accounting': True,
|
||||
'account_fiscal_country_id': 'base.ph',
|
||||
'bank_account_code_prefix': '1000',
|
||||
'cash_account_code_prefix': '1001',
|
||||
'transfer_account_code_prefix': '1002',
|
||||
'account_default_pos_receivable_account_id': 'l10n_ph_account_110003',
|
||||
'income_currency_exchange_account_id': 'l10n_ph_account_710100',
|
||||
'expense_currency_exchange_account_id': 'l10n_ph_account_710101',
|
||||
'account_journal_suspense_account_id': 'l10n_ph_account_100000',
|
||||
'default_cash_difference_income_account_id': 'l10n_ph_account_710102',
|
||||
'default_cash_difference_expense_account_id': 'l10n_ph_account_710103',
|
||||
'account_sale_tax_id': 'l10n_ph_account_tax_sale_vat_12',
|
||||
'account_purchase_tax_id': 'l10n_ph_account_tax_purchase_vat_12',
|
||||
'income_account_id': 'l10n_ph_account_430400',
|
||||
'expense_account_id': 'l10n_ph_account_620000',
|
||||
'transfer_account_id': 'l10n_ph_account_100201',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': 'l10n_ph_account_110300',
|
||||
},
|
||||
}
|
||||
|
||||
@template('ph', 'account.journal')
|
||||
def _get_ph_account_journal(self):
|
||||
return {
|
||||
"bank": {"default_account_id": "l10n_ph_account_100001"},
|
||||
}
|
||||
|
||||
@template('ph', 'account.account')
|
||||
def _get_ph_account_account(self):
|
||||
return {
|
||||
'l10n_ph_account_110300': {
|
||||
'account_stock_expense_id': 'l10n_ph_account_510000',
|
||||
'account_stock_variation_id': 'l10n_ph_account_511900',
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue