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',
|
'name': 'Payroll Report Year to Date',
|
||||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||||
'version': '11.0.1.0.0',
|
'version': '12.0.1.0.0',
|
||||||
'category': 'Human Resources',
|
'category': 'Human Resources',
|
||||||
'sequence': 95,
|
'sequence': 95,
|
||||||
'summary': 'Show YTD computations on Payslip Report',
|
'summary': 'Show YTD computations on Payslip Report',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class Payslip(models.Model):
|
|||||||
|
|
||||||
def ytd(self, code, allow_draft=False):
|
def ytd(self, code, allow_draft=False):
|
||||||
to_date = self.date_to
|
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')
|
state_allowed = ('done', 'verify') if not allow_draft else ('done', 'verify', 'draft')
|
||||||
self.env.cr.execute("""
|
self.env.cr.execute("""
|
||||||
SELECT sum(total) as sum
|
SELECT sum(total) as sum
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<template id="report_payslip_inherit" name="Payslip YTD" inherit_id="hr_payroll.report_payslip">
|
<template id="report_payslip_inherit" name="Payslip YTD" inherit_id="hr_payroll.report_payslip">
|
||||||
<!-- Add YTD to the table head-->
|
<!-- 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>
|
<th>YTD</th>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- Add YTD table data-->
|
<!-- Add YTD table data-->
|
||||||
<xpath expr="//table[@class='table table-condensed']/tbody//td[last()]" position="after">
|
<xpath expr="//table[2]/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>
|
<td><span t-esc="o.ytd(line.code, allow_draft=True)" t-options="{"widget": "monetary", "display_currency": o.company_id.currency_id}"/></td>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</odoo>
|
</odoo>
|
||||||
Reference in New Issue
Block a user