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>
This commit is contained in:
@@ -324,6 +324,17 @@ func initStockPicking() {
|
||||
return true, nil
|
||||
})
|
||||
|
||||
// action_cancel: Cancel a picking and all its moves.
|
||||
// Mirrors: odoo/addons/stock/models/stock_picking.py StockPicking.action_cancel()
|
||||
m.RegisterMethod("action_cancel", func(rs *orm.Recordset, args ...interface{}) (interface{}, error) {
|
||||
env := rs.Env()
|
||||
for _, pickingID := range rs.IDs() {
|
||||
env.Tx().Exec(env.Ctx(), `UPDATE stock_move SET state = 'cancel' WHERE picking_id = $1`, pickingID)
|
||||
env.Tx().Exec(env.Ctx(), `UPDATE stock_picking SET state = 'cancel' WHERE id = $1`, pickingID)
|
||||
}
|
||||
return true, nil
|
||||
})
|
||||
|
||||
// button_validate transitions a picking → done via _action_done on its moves.
|
||||
// Properly updates quants and clears reservations.
|
||||
// Mirrors: stock.picking.button_validate()
|
||||
|
||||
Reference in New Issue
Block a user