mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
MIG hr_payroll_slip_ytd to 12.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
'name': 'Payroll Report Year to Date',
|
||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||
'version': '11.0.1.0.0',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Human Resources',
|
||||
'sequence': 95,
|
||||
'summary': 'Show YTD computations on Payslip Report',
|
||||
|
||||
@@ -6,7 +6,7 @@ class Payslip(models.Model):
|
||||
|
||||
def ytd(self, code, allow_draft=False):
|
||||
to_date = self.date_to
|
||||
from_date = self.date_to[:4] + '-01-01'
|
||||
from_date = str(self.date_to.year) + '-01-01'
|
||||
state_allowed = ('done', 'verify') if not allow_draft else ('done', 'verify', 'draft')
|
||||
self.env.cr.execute("""
|
||||
SELECT sum(total) as sum
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<odoo>
|
||||
<template id="report_payslip_inherit" name="Payslip YTD" inherit_id="hr_payroll.report_payslip">
|
||||
<!-- Add YTD to the table head-->
|
||||
<xpath expr="//table[@class='table table-condensed']/thead/tr//th[last()]" position="after">
|
||||
<xpath expr="//table[2]/thead/tr//th[last()]" position="after">
|
||||
<th>YTD</th>
|
||||
</xpath>
|
||||
|
||||
<!-- Add YTD table data-->
|
||||
<xpath expr="//table[@class='table table-condensed']/tbody//td[last()]" position="after">
|
||||
<td><span t-esc="o.ytd(line.code, allow_draft=True)" t-esc-options="{"widget": "monetary", "display_currency": o.company_id.currency_id}"/></td>
|
||||
<xpath expr="//table[2]/tbody//td[last()]" position="after">
|
||||
<td><span t-esc="o.ytd(line.code, allow_draft=True)" t-options="{"widget": "monetary", "display_currency": o.company_id.currency_id}"/></td>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user