Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Aconcagua
hr_payroll_base_config
Commits
e96645d7
Commit
e96645d7
authored
Apr 11, 2022
by
jira
Browse files
[FIX] hr.payslip.run: action_done and action_draft now working
parent
bdd5327d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
models/hr_payslip_run.py
models/hr_payslip_run.py
+17
-0
No files found.
models/hr_payslip_run.py
View file @
e96645d7
...
...
@@ -21,6 +21,23 @@ class HrPayslipRun(models.Model):
struct_id
=
fields
.
Many2one
(
'hr.payroll.structure'
,
name
=
'Struct'
)
@
api
.
multi
def
draft_payslip_run
(
self
):
slips
=
self
.
mapped
(
"slip_ids"
)
slips
.
action_payslip_cancel
()
slips
.
write
({
'state'
:
'draft'
})
return
super
(
HrPayslipRun
,
self
).
draft_payslip_run
()
@
api
.
multi
def
close_payslip_run
(
self
):
ctx
=
dict
(
self
.
env
.
context
)
for
form
in
self
:
ctx
[
'accounting_date'
]
=
form
.
accounting_date
for
slip
in
form
.
slip_ids
.
with_context
(
ctx
):
slip
.
with_context
(
compute_sheet
=
False
).
action_payslip_done
()
return
super
(
HrPayslipRun
,
self
).
close_payslip_run
()
def
_recompute_slip_ids
(
self
):
return
self
.
slip_ids
.
compute_sheet
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment