Skip to content
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
2 changes: 1 addition & 1 deletion docsource/modules150-160.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| hr_work_entry | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| hr_work_entry_contract | | |
| hr_work_entry_contract |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| hr_work_entry_holidays | |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
if not openupgrade.column_exists(env.cr, "hr_contract", "last_generation_date"):
openupgrade.logged_query(
env.cr,
"""
ALTER TABLE hr_contract
ADD COLUMN IF NOT EXISTS last_generation_date date;
""",
)
openupgrade.logged_query(
env.cr,
"""
UPDATE hr_contract
SET last_generation_date = (
SELECT MAX(date(create_date))
FROM hr_work_entry
WHERE contract_id = hr_contract.id
)
""",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---Models in module 'hr_work_entry_contract'---
---Fields in module 'hr_work_entry_contract'---
hr_work_entry_contract / hr.contract / last_generation_date (date) : NEW
# DONE: pre-migration (set value)
hr_work_entry_contract / hr.contract / work_entry_source (selection) : NEW required, selection_keys: ['calendar'], hasdefault: default
---XML records in module 'hr_work_entry_contract'---
NEW ir.cron: hr_work_entry_contract.ir_cron_generate_missing_work_entries (noupdate)
NEW ir.ui.view: hr_work_entry_contract.hr_contract_view_form_inherit_work_entry