Browse Source

[UPDT] Updated 'hr_payroll_community'

pull/145/head
Ajmal JK 5 years ago
parent
commit
bfc4736616
  1. 2
      hr_payroll_community/__manifest__.py
  2. 12
      hr_payroll_community/models/hr_contract.py
  3. 9
      hr_payroll_community/models/hr_employee.py
  4. BIN
      hr_payroll_community/static/description/web_icons.png
  5. 49
      hr_payroll_community/views/hr_contract_views.xml
  6. 2
      hr_payroll_community/views/hr_employee_views.xml

2
hr_payroll_community/__manifest__.py

@ -3,7 +3,7 @@
{
'name': 'Odoo13 Payroll',
'category': 'Generic Modules/Human Resources',
'version': '13.0.1.2.1',
'version': '13.0.1.3.2',
'author': 'Odoo SA,Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',

12
hr_payroll_community/models/hr_contract.py

@ -23,12 +23,12 @@ class HrContract(models.Model):
], string='Scheduled Pay', index=True, default='monthly',
help="Defines the frequency of the wage payment.")
resource_calendar_id = fields.Many2one(required=True, help="Employee's working schedule.")
hra = fields.Integer(string="HRA", help="House rent allowance")
travel_allowance = fields.Integer(string="Travel Allowance", help="Travel allowance")
da = fields.Integer(string="DA", help="Dearness allowance")
meal_allowance = fields.Integer(string="Meal Allowance", help="Meal allowance")
medical_allowance = fields.Integer(string="Medical Allowance", help="Medical allowance")
other_allowance = fields.Integer(string="Other Allowance", help="Other allowances")
hra = fields.Monetary(string='HRA', tracking=True, help="House rent allowance.")
travel_allowance = fields.Monetary(string="Travel Allowance", help="Travel allowance")
da = fields.Monetary(string="DA", help="Dearness allowance")
meal_allowance = fields.Monetary(string="Meal Allowance", help="Meal allowance")
medical_allowance = fields.Monetary(string="Medical Allowance", help="Medical allowance")
other_allowance = fields.Monetary(string="Other Allowance", help="Other allowances")
def get_all_structures(self):
"""

9
hr_payroll_community/models/hr_employee.py

@ -8,8 +8,13 @@ class HrEmployee(models.Model):
_description = 'Employee'
slip_ids = fields.One2many('hr.payslip', 'employee_id', string='Payslips', readonly=True, help="payslip")
payslip_count = fields.Integer(compute='_compute_payslip_count', string='Payslip Count', groups="hr_payroll_community.group_hr_payroll_user")
payslip_count = fields.Integer(compute='_compute_payslip_count', string='Payslip Count')
def _compute_payslip_count(self):
payslip_data = self.env['hr.payslip'].sudo().read_group([('employee_id', 'in', self.ids)],
['employee_id'], ['employee_id'])
result = dict((data['employee_id'][0], data['employee_id_count']) for data in payslip_data)
for employee in self:
employee.payslip_count = len(employee.slip_ids)
employee.payslip_count = result.get(employee.id, 0)

BIN
hr_payroll_community/static/description/web_icons.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

49
hr_payroll_community/views/hr_contract_views.xml

@ -3,7 +3,7 @@
<!-- Root Menus -->
<menuitem id="menu_hr_payroll_community_root" name="Payroll" sequence="45"
web_icon="hr_payroll_community,static/description/icon.png"/>
web_icon="hr_payroll_community,static/description/web_icons.png"/>
<menuitem id="menu_hr_payroll_community_configuration" name="Configuration" parent="menu_hr_payroll_community_root"
sequence="100" groups="hr_payroll_community.group_hr_payroll_community_manager"/>
@ -17,7 +17,7 @@
<field name="struct_id" required="1"/>
</xpath>
<xpath expr="//field[@name='type_id']" position="before">
<!-- <field name="company_id" groups="base.group_multi_company"/>-->
<!-- <field name="company_id" groups="base.group_multi_company"/>-->
<field name="currency_id" invisible="1"/>
</xpath>
<xpath expr="//field[@name='resource_calendar_id']" position="after">
@ -60,17 +60,42 @@
<field name="inherit_id" ref="hr_contract.hr_contract_view_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='salary_and_advantages']" position="after">
<group name="allowances" string="Allowance">
<group>
<field name="hra"/>
<field name="da"/>
<field name="travel_allowance"/>
<field name="meal_allowance"/>
<field name="medical_allowance"/>
<field name="other_allowance"/>
</group>
</group>
<group name="allowances" string="Monthly Advantages in Cash">
<label for="hra"/>
<div class="o_row">
<field name="hra" nolabel="1"/>
<span>/ month</span>
</div>
<label for="da"/>
<div class="o_row">
<field name="da" nolabel="1"/>
<span>/ month</span>
</div>
<label for="travel_allowance"/>
<div class="o_row">
<field name="travel_allowance" nolabel="1"/>
<span>/ month</span>
</div>
<label for="meal_allowance"/>
<div class="o_row">
<field name="meal_allowance" nolabel="1"/>
<span>/ month</span>
</div>
<label for="medical_allowance"/>
<div class="o_row">
<field name="medical_allowance" nolabel="1"/>
<span>/ month</span>
</div>
<label for="other_allowance"/>
<div class="o_row">
<field name="other_allowance" nolabel="1"/>
<span>/ month</span>
</div>
</group>
</xpath>
</field>
</record>

2
hr_payroll_community/views/hr_employee_views.xml

@ -10,7 +10,7 @@
<xpath expr="//div[@name='button_box']" position="inside">
<button name="%(act_hr_employee_payslip_list)d"
class="oe_stat_button"
icon="fa-money"
icon="fa-credit-card"
type="action"
groups="hr_payroll_community.group_hr_payroll_community_user">
<field name="payslip_count" widget="statinfo" string="Payslips"/>

Loading…
Cancel
Save