Initial commit: L10N_Asia Pacific packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:52 +02:00
commit 54c86b612c
828 changed files with 58224 additions and 0 deletions

View file

@ -0,0 +1,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import res_partner
from . import account_move
from . import account_payment
from . import account_tax
from . import account_tax_template

View file

@ -0,0 +1,19 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, models
from odoo.exceptions import UserError
class AccountMove(models.Model):
_inherit = "account.move"
def action_open_l10n_ph_2307_wizard(self):
vendor_bills = self.filtered_domain([('move_type', '=', 'in_invoice')])
if vendor_bills:
wizard_action = self.env["ir.actions.act_window"]._for_xml_id("l10n_ph.view_l10n_ph_2307_wizard_act_window")
wizard_action.update({
'context': {'default_moves_to_export': vendor_bills.ids}
})
return wizard_action
else:
raise UserError(_('Only Vendor Bills are available.'))

View file

@ -0,0 +1,19 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, models
from odoo.exceptions import UserError
class AccountPayment(models.Model):
_inherit = "account.payment"
def action_open_l10n_ph_2307_wizard(self):
self.ensure_one()
if self.payment_type == 'outbound':
wizard_action = self.env["ir.actions.act_window"]._for_xml_id("l10n_ph.view_l10n_ph_2307_wizard_act_window")
wizard_action.update({
'context': {'default_moves_to_export': self.reconciled_bill_ids.ids}
})
return wizard_action
else:
raise UserError(_('Only Outbound Payment is available.'))

View file

@ -0,0 +1,9 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class AccountTax(models.Model):
_inherit = "account.tax"
l10n_ph_atc = fields.Char("Philippines ATC")

View file

@ -0,0 +1,14 @@
# 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

View file

@ -0,0 +1,25 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, api, models
class ResPartner(models.Model):
_inherit = "res.partner"
branch_code = fields.Char("Branch Code", default='000', compute='_compute_branch_code', store=True)
first_name = fields.Char("First Name")
middle_name = fields.Char("Middle Name")
last_name = fields.Char("Last Name")
@api.model
def _commercial_fields(self):
return super()._commercial_fields() + ['branch_code']
@api.depends('vat', 'country_id')
def _compute_branch_code(self):
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)
branch_code = match and match.group(1) and match.group(1)[1:] or branch_code
partner.branch_code = branch_code