diff --git a/addons/hr_payroll/report/payslip.rml b/addons/hr_payroll/report/payslip.rml
index 26c59391234..d70e4b6a362 100644
--- a/addons/hr_payroll/report/payslip.rml
+++ b/addons/hr_payroll/report/payslip.rml
@@ -392,7 +392,7 @@
Basic Salary
|
- [[ formatLang(o.basic_before_leaves, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]
+ [[ formatLang(o.contract_id.wage, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]
|
Leaved Deduction
@@ -521,35 +521,7 @@
-
-
- |
- Other Lines
- |
-
- Payments - [[ get_month(o) ]]
- |
-
- Deduction -[[ get_month(o) ]]
- |
-
-
-
- [[repeatIn(get_others(o.line_ids),'ol') ]]
-
-
- |
- [[ ol.code or '' ]]
- |
-
- [[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id and o.company_id.currency_id.symbol or '' ]]
- |
-
- [[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['otherdeduct','installment'] and o.company_id and o.company_id.currency_id.symbol or '' ]]
- |
-
-
-
+
|
diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py
index d5cd6532251..e4c44a8fc95 100644
--- a/addons/hr_payroll/report/report_payslip.py
+++ b/addons/hr_payroll/report/report_payslip.py
@@ -36,33 +36,21 @@ class payslip_report(report_sxw.rml_parse):
'get_earnings': self.get_earnings,
'get_deductions':self.get_deductions,
'get_leave':self.get_leave,
- 'get_others':self.get_others,
})
def convert(self, amount, cur):
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
return amt_en
- def get_others(self, obj):
- payslip_line = self.pool.get('hr.payslip.line')
- res = []
- ids = []
- for id in range(len(obj)):
- if obj[id].category_id.type in ('advance', 'loan', 'otherpay', 'otherdeduct', 'installment'):
- ids.append(obj[id].id)
- if ids:
- res = payslip_line.browse(self.cr, self.uid, ids)
- return res
-
def get_leave(self, obj):
payslip_line = self.pool.get('hr.payslip.line')
res = []
- ids = []
- for id in range(len(obj)):
- if obj[id].type == 'leaves':
- ids.append(obj[id].id)
- if ids:
- res = payslip_line.browse(self.cr, self.uid, ids)
+# ids = []
+# for id in range(len(obj)):
+# if obj[id].type == 'leaves':
+# ids.append(obj[id].id)
+# if ids:
+# res = payslip_line.browse(self.cr, self.uid, ids)
return res
def get_earnings(self, obj):
@@ -70,7 +58,7 @@ class payslip_report(report_sxw.rml_parse):
res = []
ids = []
for id in range(len(obj)):
- if obj[id].category_id.type == 'allowance' and obj[id].type != 'leaves':
+ if obj[id].category_id.parent_id.name == 'Allowance':
ids.append(obj[id].id)
if ids:
res = payslip_line.browse(self.cr, self.uid, ids)
@@ -81,7 +69,7 @@ class payslip_report(report_sxw.rml_parse):
res = []
ids = []
for id in range(len(obj)):
- if obj[id].category_id.type == 'deduction' and obj[id].type != 'leaves':
+ if obj[id].category_id.parent_id.name == 'Deduction':
ids.append(obj[id].id)
if ids:
res = payslip_line.browse(self.cr, self.uid, ids)
diff --git a/addons/hr_payroll/security/ir.model.access.csv b/addons/hr_payroll/security/ir.model.access.csv
index bafa1564e23..d24699752ec 100644
--- a/addons/hr_payroll/security/ir.model.access.csv
+++ b/addons/hr_payroll/security/ir.model.access.csv
@@ -1,20 +1,11 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_hr_passport","hr.passport","model_hr_passport","base.group_hr_user",1,1,1,1
"access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,1,1,1
-"access_hr_payroll_register","hr.payroll.register","model_hr_payroll_register","base.group_hr_user",1,1,1,1
-"access_hr_payroll_advice","hr.payroll.advice","model_hr_payroll_advice","base.group_hr_user",1,1,1,1
-"access_hr_payroll_advice_line","hr.payroll.advice.line","model_hr_payroll_advice_line","base.group_hr_user",1,1,1,1
"access_hr_contibution_register","hr.contibution.register","model_hr_contibution_register","base.group_hr_user",1,1,1,1
"access_hr_contibution_register_line","hr.contibution.register.line","model_hr_contibution_register_line","base.group_hr_user",1,1,1,1
-"access_hr_allounce_deduction_category","hr.allounce.deduction.category","model_hr_allounce_deduction_categoty","base.group_hr_user",1,1,1,1
-"access_company_contribution","company.contribution","model_company_contribution","base.group_hr_user",1,1,1,1
-"access_company_contribution_line","company.contribution.line","model_company_contribution_line","base.group_hr_user",1,1,1,1
+"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,1,1,1
"access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,1,1,1
"access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,1,1,1
-"access_hr_payslip_line_line","hr.payslip.line.line","model_hr_payslip_line_line","base.group_hr_user",1,1,1,1
"access_res_partner_payroll","res.partner.payroll","base.model_res_partner","base.group_hr_user",1,1,1,1
"access_hr_payslip_manager","hr.payslip.manager","model_hr_payslip","base.group_hr_manager",1,1,1,1
"access_hr_payslip_line_manager","hr.payslip.line.manager","model_hr_payslip_line","base.group_hr_manager",1,1,1,1
"access_hr_payroll_structure_manager","hr.payroll.structure.manager","model_hr_payroll_structure","base.group_hr_manager",1,1,1,1
-"access_hr_passport_manager","hr.passport.manager","model_hr_passport","base.group_hr_manager",1,1,1,1
-"access_hr_contract_wage_type","hr.contract.wage.type user","hr_contract.model_hr_contract_wage_type","base.group_hr_user",1,1,1,1
diff --git a/addons/resource/resource.py b/addons/resource/resource.py
index d2c284891ef..e2d329bf2c7 100644
--- a/addons/resource/resource.py
+++ b/addons/resource/resource.py
@@ -43,6 +43,18 @@ class resource_calendar(osv.osv):
'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'resource.calendar', context=context)
}
+ def working_hours_on_day(self, cr, uid, resource_calendar_id, day, context=None):
+ """
+ @param resource_calendar_id: resource.calendar browse record
+ @param day: datetime object
+ @return: returns the working hours (as float) men should work on the given day if is in the attendance_ids of the resource_calendar_id (i.e if that day is a working day), returns 0.0 otherwise
+ """
+ res = 0.0
+ for working_day in resource_calendar_id.attendance_ids:
+ if (int(working_day.dayofweek) + 1) == day.isoweekday():
+ res += working_day.hour_to - working_day.hour_from
+ return res
+
def _get_leaves(self, cr, uid, id, resource):
resource_cal_leaves = self.pool.get('resource.calendar.leaves')
dt_leave = []
| |