[IMP] hr_payslip_line_date: Add hr_payslip_line_date to Odoo v13

Add the hr_payslip_line module to Odoo13

H3953
This commit is contained in:
Leighton Pennicott
2020-10-08 16:31:39 -04:00
committed by Jared Kipe
parent 157670291a
commit 031af239e5
6 changed files with 83 additions and 3 deletions

3
hr_payslip_line_date/__init__.py Executable file → Normal file
View File

@@ -1,2 +1 @@
# -*- coding: utf-8 -*- from . import models
from . import payslip

View File

@@ -17,7 +17,8 @@ Date on Payslip Lines
'auto_install': True, 'auto_install': True,
'website': 'https://hibou.io/', 'website': 'https://hibou.io/',
'data': [ 'data': [
'payslip_view.xml', 'views/payslip_view.xml',
'views/payslip_menu.xml',
], ],
'installable': True 'installable': True
} }

View File

@@ -0,0 +1 @@
from . import payslip

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<act_window id="action_payslip"
name="Payslip List"
res_model="hr.payslip.line"
view_mode="tree,pivot" />
<menuitem id="payslip_reporting_view"
name="Payslip Lines"
parent="hr_payroll.menu_hr_payroll_report"
action="action_payslip" />
</odoo>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<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.hr_payslip_line_view_search_register"/>
<field name="arch" type="xml">
<data>
<xpath expr="//filter[@name='last_month']" position="attributes">
<attribute name="string">Last Month (Date From)</attribute>
</xpath>
<xpath expr="//filter[@name='last_quarter']" position="attributes">
<attribute name="string">Last Quarter (Date From)</attribute>
</xpath>
<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>
<record id="view_hr_payslip_line_tree_extend" model="ir.ui.view">
<field name="name">hr.payslip.line.tree.extend</field>
<field name="model">hr.payslip.line</field>
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_line_tree" />
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="editable" />
</xpath>
<xpath expr="//field[@name='sequence']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//field[@name='category_id']" position="before">
<field name="slip_id"/>
</xpath>
</field>
</record>
</odoo>