Stock (1193→2867 LOC): - Valuation layers (FIFO consumption, product valuation history) - Landed costs (split by equal/qty/cost/weight/volume, validation) - Stock reports (by product, by location, move history, valuation) - Forecasting (on_hand + incoming - outgoing per product) - Batch transfers (confirm/assign/done with picking delegation) - Barcode interface (scan product/lot/package/location, qty increment) CRM (233→1113 LOC): - Sales teams with dashboard KPIs (opportunity count/amount/unassigned) - Team members with lead capacity + round-robin auto-assignment - Lead extended: activities, UTM tracking, scoring, address fields - Lead methods: merge, duplicate, schedule activity, set priority/stage - Pipeline analysis (stages, win rate, conversion, team/salesperson perf) - Partner onchange (auto-populate contact from partner) HR (223→520 LOC): - Leave management: hr.leave.type, hr.leave, hr.leave.allocation with full approval workflow (draft→confirm→validate/refuse) - Attendance: check in/out with computed worked_hours - Expenses: hr.expense + hr.expense.sheet with state machine - Skills/Resume: skill types, employee skills, resume lines - Employee extensions: skills, attendance, leave count links Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
54 lines
2.2 KiB
Go
54 lines
2.2 KiB
Go
package models
|
|
|
|
import "odoo-go/pkg/orm"
|
|
|
|
// initHrSkill registers hr.skill.type, hr.skill, hr.employee.skill and hr.resume.line.
|
|
// Mirrors: odoo/addons/hr_skills/models/hr_skill.py
|
|
func initHrSkill() {
|
|
orm.NewModel("hr.skill.type", orm.ModelOpts{
|
|
Description: "Skill Type",
|
|
Order: "name",
|
|
}).AddFields(
|
|
orm.Char("name", orm.FieldOpts{String: "Name", Required: true}),
|
|
orm.One2many("skill_ids", "hr.skill", "skill_type_id", orm.FieldOpts{String: "Skills"}),
|
|
)
|
|
|
|
orm.NewModel("hr.skill", orm.ModelOpts{
|
|
Description: "Skill",
|
|
Order: "name",
|
|
}).AddFields(
|
|
orm.Char("name", orm.FieldOpts{String: "Name", Required: true}),
|
|
orm.Many2one("skill_type_id", "hr.skill.type", orm.FieldOpts{String: "Skill Type", Required: true}),
|
|
)
|
|
|
|
orm.NewModel("hr.employee.skill", orm.ModelOpts{
|
|
Description: "Employee Skill",
|
|
}).AddFields(
|
|
orm.Many2one("employee_id", "hr.employee", orm.FieldOpts{String: "Employee", Required: true, OnDelete: orm.OnDeleteCascade}),
|
|
orm.Many2one("skill_id", "hr.skill", orm.FieldOpts{String: "Skill", Required: true}),
|
|
orm.Many2one("skill_type_id", "hr.skill.type", orm.FieldOpts{String: "Skill Type"}),
|
|
orm.Selection("skill_level", []orm.SelectionItem{
|
|
{Value: "beginner", Label: "Beginner"},
|
|
{Value: "intermediate", Label: "Intermediate"},
|
|
{Value: "advanced", Label: "Advanced"},
|
|
{Value: "expert", Label: "Expert"},
|
|
}, orm.FieldOpts{String: "Level", Default: "beginner"}),
|
|
)
|
|
|
|
orm.NewModel("hr.resume.line", orm.ModelOpts{
|
|
Description: "Resume Line",
|
|
Order: "date_start desc",
|
|
}).AddFields(
|
|
orm.Many2one("employee_id", "hr.employee", orm.FieldOpts{String: "Employee", Required: true, OnDelete: orm.OnDeleteCascade}),
|
|
orm.Char("name", orm.FieldOpts{String: "Name", Required: true}),
|
|
orm.Date("date_start", orm.FieldOpts{String: "Start Date", Required: true}),
|
|
orm.Date("date_end", orm.FieldOpts{String: "End Date"}),
|
|
orm.Text("description", orm.FieldOpts{String: "Description"}),
|
|
orm.Selection("line_type_id", []orm.SelectionItem{
|
|
{Value: "experience", Label: "Experience"},
|
|
{Value: "education", Label: "Education"},
|
|
{Value: "certification", Label: "Certification"},
|
|
}, orm.FieldOpts{String: "Type", Default: "experience"}),
|
|
)
|
|
}
|