Fix DB setup: savepoints for seed, deduplicate AddField, field fixes
Critical fixes for fresh DB creation: - AddField now skips duplicates (ExtendModel from multiple modules was adding same field twice → duplicate column error) - SeedWithSetup wrapped in savepoints per seed block (one failing INSERT no longer aborts entire transaction) - sale.order.cancel: display_name → cancel_reason (avoid magic field clash) - purchase: removed duplicate supplier_rank (already on res.partner) - safeExec helper: SAVEPOINT + ROLLBACK TO on error Fresh DB creation now works: - /web/database/create → creates all tables, seeds data, returns session - Login works immediately after creation - All 191 models, 51 menus, 34 actions seeded Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -290,7 +290,7 @@ func initSaleOrderWarnMsg() {
|
||||
|
||||
m.AddFields(
|
||||
orm.Many2one("order_id", "sale.order", orm.FieldOpts{String: "Sale Order"}),
|
||||
orm.Text("display_name", orm.FieldOpts{String: "Warning"}),
|
||||
orm.Text("cancel_reason", orm.FieldOpts{String: "Cancellation Reason"}),
|
||||
)
|
||||
|
||||
// action_cancel: Confirm the cancellation of the sale order.
|
||||
|
||||
Reference in New Issue
Block a user