Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] hr_payroll_period: remove warnings #131

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions hr_payroll_period/migrations/14.0.1.0.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo.tools.sql import column_exists, rename_column


def migrate(cr, version):
if column_exists(cr, "hr_contract", "shedule_pay"):
rename_column(
cr,
"hr_contract",
"shedule_pay",
"schedule_pay",
)
4 changes: 1 addition & 3 deletions hr_payroll_period/models/hr_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ class HrContract(models.Model):
_inherit = "hr.contract"

# Add semi-monthly to payroll schedules
schedule_pay = fields.Selection(
get_schedules, "Scheduled Pay", oldname="shedule_pay", index=True
)
schedule_pay = fields.Selection(get_schedules, "Scheduled Pay", index=True)
2 changes: 1 addition & 1 deletion hr_payroll_period/models/hr_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class HrEmployee(models.AbstractModel):
_inherit = "hr.employee.base"

contract_id = fields.Many2one(search="_search_contract")
contract_id = fields.Many2one(comodel_name="hr.contract", search="_search_contract")

@api.model
def _search_contract(self, operator, value):
Expand Down
Loading