MIG hr_payslip_line_date to 12.0

This commit is contained in:
Jared Kipe
2019-05-20 15:54:00 -07:00
parent 681499463f
commit 27c23e2299
2 changed files with 37 additions and 40 deletions

View File

@@ -1,23 +1,22 @@
# -*- encoding: utf-8 -*-
{
'name': 'Date on Payslip Lines',
'author': 'Hibou Corp. <hello@hibou.io>',
'license': 'AGPL-3',
'category': 'Human Resources',
'depends': ['hr_payroll_account'],
'version': '11.0.0.0.0',
'version': '12.0.1.0.0',
'description': """
Date on Payslip Lines
=====================
* Adds "Date Account" (date) field to payslip line from payslip
* Adds group by date to Payslip Line search view
* Allows filtering by "Date Account" for easy period reporting
* Adds "Date Account" (date) field to payslip line from payslip
* Adds group by date to Payslip Line search view
* Allows filtering by "Date Account" for easy period reporting
""",
'auto_install': True,
'website': 'https://hibou.io/',
'data':[
'data': [
'payslip_view.xml',
],
'installable': True

View File

@@ -1,37 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="payslip_line_filter_date" model="ir.ui.view">
<field name="name">hr.payslip.line.select</field>
<field name="model">hr.payslip.line</field>
<field name="priority">20</field>
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_line_filter"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group" position="before">
<separator string="Date Account"/>
<filter name="this_week" string="This Week" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d')), ('date', '&lt;', (context_today() - datetime.timedelta(days=0)).strftime('%Y-%m-%d'))]"/>
<filter name="last_week" string="Last Week" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=14)).strftime('%Y-%m-%d')), ('date', '&lt;', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"/>
<filter name="last_two_week" string="Two Weeks Ago" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=21)).strftime('%Y-%m-%d')), ('date', '&lt;', (context_today() - datetime.timedelta(days=14)).strftime('%Y-%m-%d'))]"/>
<filter name="last_three_week" string="Three Weeks Ago" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=28)).strftime('%Y-%m-%d')), ('date', '&lt;', (context_today() - datetime.timedelta(days=21)).strftime('%Y-%m-%d'))]"/>
<filter name="this_month" string="This Month" domain="[('date', '&gt;=', context_today().strftime('%Y-%m-01')), ('date', '&lt;=', (context_today().replace(day=28) + datetime.timedelta(days=4)).strftime('%Y-%m-01'))]"/>
<filter name="last_month" string="Last Month" domain="[('date', '&lt;', context_today().strftime('%Y-%m-01')), ('date', '&gt;=', (context_today().replace(day=1) - datetime.timedelta(days=1)).strftime('%Y-%m-01'))]"/>
<separator string="This Year"/>
<filter name="this_year_q1" string="This Year Q1" domain="[('date', '&gt;=', context_today().strftime('%Y-01-01')), ('date', '&lt;', context_today().strftime('%Y-04-01'))]" />
<filter name="this_year_q2" string="This Year Q2" domain="[('date', '&gt;=', context_today().strftime('%Y-04-01')), ('date', '&lt;', context_today().strftime('%Y-07-01'))]" />
<filter name="this_year_q3" string="This Year Q3" domain="[('date', '&gt;=', context_today().strftime('%Y-07-01')), ('date', '&lt;', context_today().strftime('%Y-10-01'))]" />
<filter name="this_year_q4" string="This Year Q4" domain="[('date', '&gt;=', context_today().strftime('%Y-10-01')), ('date', '&lt;=', context_today().strftime('%Y-12-31'))]" />
<separator string="Last Year"/>
<filter name="this_year_q1" string="Last Year Q1" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-01-01')), ('date', '&lt;', (context_today() - datetime.timedelta(days=365)).strftime('%Y-04-01'))]" />
<filter name="this_year_q2" string="Last Year Q2" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-04-01')), ('date', '&lt;', (context_today() - datetime.timedelta(days=365)).strftime('%Y-07-01'))]" />
<filter name="this_year_q3" string="Last Year Q3" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-07-01')), ('date', '&lt;', (context_today() - datetime.timedelta(days=365)).strftime('%Y-10-01'))]" />
<filter name="this_year_q4" string="Last Year Q4" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-10-01')), ('date', '&lt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-12-31'))]" />
</xpath>
<xpath expr="//group" position="inside">
<filter string="Account Date" name="date" context="{'group_by':'date'}"/>
</xpath>
</data>
</field>
</record>
</data>
<record id="payslip_line_filter_date" model="ir.ui.view">
<field name="name">hr.payslip.line.select</field>
<field name="model">hr.payslip.line</field>
<field name="priority">20</field>
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_line_filter"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group" position="before">
<separator string="Date Account"/>
<filter name="this_week" string="This Week" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d')), ('date', '&lt;', (context_today() - datetime.timedelta(days=0)).strftime('%Y-%m-%d'))]"/>
<filter name="last_week" string="Last Week" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=14)).strftime('%Y-%m-%d')), ('date', '&lt;', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"/>
<filter name="last_two_week" string="Two Weeks Ago" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=21)).strftime('%Y-%m-%d')), ('date', '&lt;', (context_today() - datetime.timedelta(days=14)).strftime('%Y-%m-%d'))]"/>
<filter name="last_three_week" string="Three Weeks Ago" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=28)).strftime('%Y-%m-%d')), ('date', '&lt;', (context_today() - datetime.timedelta(days=21)).strftime('%Y-%m-%d'))]"/>
<filter name="this_month" string="This Month" domain="[('date', '&gt;=', context_today().strftime('%Y-%m-01')), ('date', '&lt;=', (context_today().replace(day=28) + datetime.timedelta(days=4)).strftime('%Y-%m-01'))]"/>
<filter name="last_month" string="Last Month" domain="[('date', '&lt;', context_today().strftime('%Y-%m-01')), ('date', '&gt;=', (context_today().replace(day=1) - datetime.timedelta(days=1)).strftime('%Y-%m-01'))]"/>
<separator string="This Year"/>
<filter name="this_year_q1" string="This Year Q1" domain="[('date', '&gt;=', context_today().strftime('%Y-01-01')), ('date', '&lt;', context_today().strftime('%Y-04-01'))]" />
<filter name="this_year_q2" string="This Year Q2" domain="[('date', '&gt;=', context_today().strftime('%Y-04-01')), ('date', '&lt;', context_today().strftime('%Y-07-01'))]" />
<filter name="this_year_q3" string="This Year Q3" domain="[('date', '&gt;=', context_today().strftime('%Y-07-01')), ('date', '&lt;', context_today().strftime('%Y-10-01'))]" />
<filter name="this_year_q4" string="This Year Q4" domain="[('date', '&gt;=', context_today().strftime('%Y-10-01')), ('date', '&lt;=', context_today().strftime('%Y-12-31'))]" />
<separator string="Last Year"/>
<filter name="this_year_q1" string="Last Year Q1" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-01-01')), ('date', '&lt;', (context_today() - datetime.timedelta(days=365)).strftime('%Y-04-01'))]" />
<filter name="this_year_q2" string="Last Year Q2" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-04-01')), ('date', '&lt;', (context_today() - datetime.timedelta(days=365)).strftime('%Y-07-01'))]" />
<filter name="this_year_q3" string="Last Year Q3" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-07-01')), ('date', '&lt;', (context_today() - datetime.timedelta(days=365)).strftime('%Y-10-01'))]" />
<filter name="this_year_q4" string="Last Year Q4" domain="[('date', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-10-01')), ('date', '&lt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-12-31'))]" />
</xpath>
<xpath expr="//group" position="inside">
<filter string="Account Date" name="date" context="{'group_by':'date'}"/>
</xpath>
</data>
</field>
</record>
</odoo>