Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
hr
hr_employee_loans
Merge requests
!12
[FIX] fixed extra_concept function
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[FIX] fixed extra_concept function
rr-212
into
12.0-stage
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Brian Misael López
requested to merge
rr-212
into
12.0-stage
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
12.0-stage
12.0-stage (base)
and
latest version
latest version
674c02d2
1 commit,
3 years ago
1 file
+
7
−
6
Expand all files
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
wizard/extra_concept.py
+
7
−
6
Options
@@ -9,7 +9,6 @@ class ExtraConcept(models.TransientModel):
extra_concept_month_date
=
fields
.
Date
(
string
=
'
Start Moth
'
)
extra_concept_month_end_date
=
fields
.
Date
(
string
=
'
End Moth
'
)
def
get_loan_salary_rule
(
self
):
loan_salary_rule
=
self
.
env
[
'
ir.config_parameter
'
].
sudo
().
get_param
(
'
hr_employee_loans.loans_salary_rule_id
'
)
or
False
@@ -21,11 +20,13 @@ class ExtraConcept(models.TransientModel):
loan_salary_rule_id
=
self
.
get_loan_salary_rule
()
loan_lines
=
[]
loans
=
self
.
env
[
'
hr.employee.loans
'
].
search
([(
'
state
'
,
'
=
'
,
'
in_progress
'
)])
for
loan
in
loans
:
if
self
.
employee_id
:
loan_lines
.
append
(
loan
.
employee_loan_ids
.
filtered
(
lambda
r
:
r
.
employee_id
.
id
==
self
.
employee_id
.
id
and
r
.
start_date
<=
self
.
extra_concept_month_date
and
r
.
end_date
>=
self
.
extra_concept_month_end_date
and
r
.
state
==
'
draft
'
))
else
:
employee_loans
=
loans
.
filtered
(
lambda
l
:
l
.
employee_id
.
id
==
self
.
employee_id
)
if
employee_loans
:
for
sing_loan
in
employee_loans
:
loan_lines
.
append
(
sing_loan
.
employee_loan_ids
.
filtered
(
lambda
r
:
r
.
start_date
<=
self
.
extra_concept_month_date
and
r
.
end_date
>=
self
.
extra_concept_month_end_date
and
r
.
state
==
'
draft
'
))
else
:
for
loan
in
loans
:
loan_lines
.
append
(
loan
.
employee_loan_ids
.
filtered
(
lambda
r
:
r
.
start_date
<=
self
.
extra_concept_month_date
and
r
.
end_date
>=
self
.
extra_concept_month_end_date
and
r
.
state
==
'
draft
'
))
for
line
in
loan_lines
:
Menu
Explore
Projects
Groups
Topics
Snippets