Massive module expansion: Stock, CRM, HR — +2895 LOC
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>
This commit is contained in:
@@ -109,6 +109,22 @@ func initHREmployee() {
|
||||
})
|
||||
}
|
||||
|
||||
// initHrEmployeeExtensions adds skill, resume, attendance and leave fields
|
||||
// to hr.employee after the related models have been registered.
|
||||
func initHrEmployeeExtensions() {
|
||||
emp := orm.ExtendModel("hr.employee")
|
||||
emp.AddFields(
|
||||
orm.One2many("skill_ids", "hr.employee.skill", "employee_id", orm.FieldOpts{String: "Skills"}),
|
||||
orm.One2many("resume_line_ids", "hr.resume.line", "employee_id", orm.FieldOpts{String: "Resume"}),
|
||||
orm.One2many("attendance_ids", "hr.attendance", "employee_id", orm.FieldOpts{String: "Attendances"}),
|
||||
orm.Float("leaves_count", orm.FieldOpts{String: "Time Off", Compute: "_compute_leaves"}),
|
||||
orm.Selection("attendance_state", []orm.SelectionItem{
|
||||
{Value: "checked_out", Label: "Checked Out"},
|
||||
{Value: "checked_in", Label: "Checked In"},
|
||||
}, orm.FieldOpts{String: "Attendance", Compute: "_compute_attendance_state"}),
|
||||
)
|
||||
}
|
||||
|
||||
// initHRDepartment registers the hr.department model.
|
||||
// Mirrors: odoo/addons/hr/models/hr_department.py
|
||||
func initHRDepartment() {
|
||||
|
||||
Reference in New Issue
Block a user