mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 23:52:07 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
from datetime import datetime
|
||||
|
||||
from dateutil import relativedelta
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class PayslipLinesContributionRegister(models.TransientModel):
|
||||
_name = "payslip.lines.contribution.register"
|
||||
_description = "Payslip Lines by Contribution Registers"
|
||||
|
||||
date_from = fields.Date(
|
||||
string="Date From", required=True, default=datetime.now().strftime("%Y-%m-01")
|
||||
)
|
||||
date_to = fields.Date(
|
||||
string="Date To",
|
||||
required=True,
|
||||
default=str(
|
||||
datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1)
|
||||
)[:10],
|
||||
)
|
||||
|
||||
def print_report(self):
|
||||
active_ids = self.env.context.get("active_ids", [])
|
||||
datas = {
|
||||
"ids": active_ids,
|
||||
"model": "hr.contribution.register",
|
||||
"form": self.read()[0],
|
||||
}
|
||||
return self.env.ref("payroll.action_contribution_register").report_action(
|
||||
[], data=datas
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue