Skip to content

Commit

Permalink
Merge b871d72 into 2653f4d
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed May 25, 2018
2 parents 2653f4d + b871d72 commit 198e737
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 32 deletions.
21 changes: 0 additions & 21 deletions hr_attendance_monkeypatch/models/hr_attendance_monkeypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,6 @@ def _altern_si_so(self):
return True


@api.multi
def _altern_si_so_1(self):
for attn in self:
if not attn._do_check():
return True
continue

prev_attns = self._get_prev_attendance()
next_attns = self._get_next_attendance()

if prev_attns and prev_attns[0].action == attn.action:
return False
elif next_attns and next_attns[0].action == attn.action:
return False
elif (not prev_attns) and (not next_attns) and \
attn.action != "sign_in":
return False

return True


class HrAttendanceMonkeypatch(models.TransientModel):
_name = "hr.attendance_monkeypatch"

Expand Down
6 changes: 3 additions & 3 deletions hr_payslip_import_input/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ The file must have 3 columns head keys, which is:
Usage
=====

Import Mekanism:
----------------
Import Mechanism:
-----------------

You need to:

Expand All @@ -46,7 +46,7 @@ You need to:
3. Click "Generate Payslip" Button
4. Open *Imported Files* tab
5. Click "Import File"
4. Add file
6. Add file

Bug Tracker
===========
Expand Down
2 changes: 1 addition & 1 deletion hr_worked_days_compute_holiday/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Public Holiday Computation on Worked Days",
"version": "8.0.1.0.1",
"version": "8.0.1.0.2",
"category": "Human Resources",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
Expand Down
15 changes: 8 additions & 7 deletions hr_worked_days_compute_holiday/models/hr_payslip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models
from openerp import models, api
from datetime import datetime
from datetime import timedelta


class HrPayslip(models.Model):
_inherit = 'hr.payslip'
_inherit = "hr.payslip"

@api.model
def get_worked_day_lines(
self, cr, uid, contract_ids, date_from, date_to, context=None
self, contract_ids, date_from, date_to, context=None
):
res = super(HrPayslip, self).get_worked_day_lines(
cr, uid, contract_ids, date_from, date_to, context=None)
contract_ids, date_from, date_to, context=None)
number_of_days = 0.0
day_from = datetime.strptime(date_from, "%Y-%m-%d")
day_to = datetime.strptime(date_to, "%Y-%m-%d")
nb_of_days = (day_to - day_from).days + 1
contract_id = res[0]['contract_id']
contract = self.pool.get('hr.contract').browse(cr, uid, contract_id)
contract_id = res[0]["contract_id"]
contract = self.env["hr.contract"].browse([contract_id])[0]
for day in range(0, nb_of_days):
work_scheduled = contract.employee_id.work_scheduled_on_day(
date_dt=day_from + timedelta(days=day))
if work_scheduled:
number_of_days += 1.0
res[0].update({'number_of_days': number_of_days})
res[0].update({"number_of_days": number_of_days})
return res

0 comments on commit 198e737

Please sign in to comment.