Files
goodie/addons/hr/models/hr_contract.go
Marc cc1f150732 Deepen all business modules: methods, validations, workflows
Account:
- action_post: partner validation, line count check, sequence number
  assignment (JOURNAL/YYYY/NNNN format)
- action_register_payment: opens payment wizard from invoice
- remove_move_reconcile: undo reconciliation, reset residuals
- Register Payment button in invoice form (visible when posted+unpaid)

Sale:
- action_cancel: cancels linked draft invoices + SO state
- action_draft: reset cancelled SO to draft
- action_view_invoice: navigate to linked invoices
- Cancel/Reset buttons in form view header

Purchase:
- button_draft: reset cancelled PO to draft
- action_create_bill already existed

Stock:
- action_cancel on picking: cancels moves + picking state

CRM:
- action_set_won_rainbowman: sets Won stage + rainbow effect
- convert_opportunity: lead→opportunity type switch

HR:
- hr.contract model (name, employee, wage, dates, state)

Project:
- action_blocked on task (kanban_state)
- Task stage seed data (New, In Progress, Done, Cancelled)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:58:01 +02:00

32 lines
1.3 KiB
Go

package models
import "odoo-go/pkg/orm"
// initHrContract registers the hr.contract model.
// Mirrors: odoo/addons/hr_contract/models/hr_contract.py
func initHrContract() {
m := orm.NewModel("hr.contract", orm.ModelOpts{
Description: "Employee Contract",
Order: "date_start desc",
})
m.AddFields(
orm.Char("name", orm.FieldOpts{String: "Contract Reference", Required: true}),
orm.Many2one("employee_id", "hr.employee", orm.FieldOpts{String: "Employee", Required: true}),
orm.Many2one("department_id", "hr.department", orm.FieldOpts{String: "Department"}),
orm.Many2one("job_id", "hr.job", orm.FieldOpts{String: "Job Position"}),
orm.Date("date_start", orm.FieldOpts{String: "Start Date", Required: true}),
orm.Date("date_end", orm.FieldOpts{String: "End Date"}),
orm.Monetary("wage", orm.FieldOpts{String: "Wage", Required: true, CurrencyField: "currency_id"}),
orm.Many2one("currency_id", "res.currency", orm.FieldOpts{String: "Currency"}),
orm.Selection("state", []orm.SelectionItem{
{Value: "draft", Label: "New"},
{Value: "open", Label: "Running"},
{Value: "close", Label: "Expired"},
{Value: "cancel", Label: "Cancelled"},
}, orm.FieldOpts{String: "Status", Default: "draft"}),
orm.Many2one("company_id", "res.company", orm.FieldOpts{String: "Company"}),
orm.Text("notes", orm.FieldOpts{String: "Notes"}),
)
}