chore: import enterprise addons 19.0 bulk snapshot

This commit is contained in:
1b-agent committed 2026-09-16 10:13:08 +00:00
commit ca4af030d3
39951 files changed
+15570005

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import hr_payroll_hsbc_autopay_wizard
@@ -0,0 +1,47 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.exceptions import ValidationError
class HrPayslipRunHsbcAutopayWizard(models.TransientModel):
_name = 'hr.payslip.run.hsbc.autopay.wizard'
_description = 'HR Payslip Run HSBC Autopay Wizard'
def _default_file_name(self):
payslip_run_id = self.env['hr.payslip.run'].browse(self.env.context.get('active_id'))
return payslip_run_id.l10n_hk_autopay_export_first_batch_filename or payslip_run_id.name
ref = fields.Char(string="First Party Reference", size=12)
customer_ref = fields.Char(string="Customer Reference", size=35)
autopay_type = fields.Selection(related='company_id.l10n_hk_autopay_type', string="Autopay Type", readonly=True)
authorisation_type = fields.Selection(
selection=[
('A', 'Pre-Authorised'),
('P', 'Instruction Level Authorisation'),
('F', 'File Level Authorisation'),
('V', 'File Level Authorisation with ability to view instructions')],
string="Authorisation Type", default='A'
)
payment_date = fields.Date(string="Payment Date", required=True, default=fields.Date.today)
batch_type = fields.Selection(selection=[('first', "First Batch"), ('second', "Second Batch")], string="Batch Type", required=True, default='first')
company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.company)
digital_pic_id = fields.Char(string="Digital Picture ID", size=11)
file_name = fields.Char(string="File Name", required=True, default=_default_file_name)
payment_set_code = fields.Char(string='Payment Set Code', required=True, size=3)
@api.constrains('payment_set_code')
def _check_payment_set_code(self):
for wizard in self:
if len(wizard.payment_set_code) != 3:
raise ValidationError(wizard.env._("Payment Set Code length must be 3 letters."))
def generate_hsbc_autopay_apc_file(self):
payslip_run_id = self.env['hr.payslip.run'].browse(self.env.context['active_id'])
payslips = payslip_run_id.mapped('slip_ids').filtered(lambda p: p.net_wage > 0)
payslips.sudo()._create_apc_file(
self.payment_date, self.payment_set_code, self.batch_type, self.ref, self.file_name,
authorisation_type=self.authorisation_type,
customer_ref=self.customer_ref,
digital_pic_id=self.digital_pic_id,
)
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_payslip_run_hsbc_autopay_view_form" model="ir.ui.view">
<field name="name">hr.payslip.run.hsbc.autopay.wizard.form</field>
<field name="model">hr.payslip.run.hsbc.autopay.wizard</field>
<field name="arch" type="xml">
<form string="Generate HSBC Autopay Report">
<field name="company_id" invisible="1" />
<field name="autopay_type" invisible="1" />
<group>
<group>
<field name="payment_date" />
<field name="batch_type" />
<field name="payment_set_code" />
<field name="ref" />
<field name="file_name" />
</group>
<group invisible="autopay_type != 'h2h'">
<field name="digital_pic_id" required="autopay_type == 'h2h'" />
<field name="customer_ref" />
<field name="authorisation_type" required="autopay_type == 'h2h'" />
</group>
</group>
<footer>
<button string="Confirm" class="btn-primary" name="generate_hsbc_autopay_apc_file" type="object" data-hotkey="q" />
<button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="x"/>
</footer>
</form>
</field>
</record>
</odoo>