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

@@ -0,0 +1,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import edit_billable_time_target
from . import res_company
@@ -0,0 +1,9 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class EditBillableTimeTarget(models.Model):
_inherit = "edit.billable.time.target"
leave_date_to = fields.Date(related='employee_id.leave_date_to', compute_sudo=True)
@@ -0,0 +1,38 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResCompany(models.Model):
_inherit = "res.company"
def _get_leaderboard_query(self):
return """
WITH A AS (
SELECT aal.employee_id AS id,
SUM(
CASE
WHEN aal.timesheet_invoice_type != 'non_billable'
THEN aal.unit_amount
ELSE 0
END
) AS billable_time,
SUM(aal.unit_amount) AS total_time,
SUM(CASE WHEN aal.date <= %s THEN aal.unit_amount ELSE 0 END) AS total_valid_time
FROM account_analytic_line aal
WHERE aal.project_id IS NOT NULL
AND aal.date BETWEEN %s AND %s
AND aal.company_id = %s
AND aal.holiday_id is NULL AND aal.global_leave_id is NULL
GROUP BY aal.employee_id
)
SELECT A.id,
he.billable_time_target,
he.name,
billable_time,
total_time,
total_valid_time,
billable_time / he.billable_time_target * 100 AS billing_rate
FROM A
LEFT JOIN hr_employee AS he ON A.id = he.id WHERE he.billable_time_target > 0
"""