Files
goodie/addons/base/models/ir_logging.go
Marc b57176de2f Bring odoo-go to ~70%: read_group, record rules, admin, sessions
Phase 1: read_group/web_read_group with SQL GROUP BY, aggregates
  (sum/avg/min/max/count/array_agg/sum_currency), date granularity,
  M2O groupby resolution to [id, display_name].

Phase 2: Record rules with domain_force parsing (Python literal parser),
  global AND + group OR merging. Domain operators: child_of, parent_of,
  any, not any compiled to SQL hierarchy/EXISTS queries.

Phase 3: Button dispatch via /web/dataset/call_button, method return
  values interpreted as actions. Payment register wizard
  (account.payment.register) for sale→invoice→pay flow.

Phase 4: ir.filters, ir.default, product fields expanded, SO line
  product_id onchange, ir_model+ir_model_fields DB seeding.

Phase 5: CSV export (/web/export/csv), attachment upload/download
  via ir.attachment, fields_get with aggregator hints.

Admin/System: Session persistence (PostgreSQL-backed), ir.config_parameter
  with get_param/set_param, ir.cron, ir.logging, res.lang, res.config.settings
  with company-related fields, Settings form view. Technical menu with
  Views/Actions/Parameters/Security/Logging sub-menus. User change_password,
  preferences. Password never exposed in UI/API.

Bugfixes: false→nil for varchar/int fields, int32 in toInt64, call_button
  route with trailing slash, create_invoices returns action, search view
  always included, get_formview_action, name_create, ir.http stub.

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

36 lines
1.2 KiB
Go

package models
import "odoo-go/pkg/orm"
// initIrLogging registers ir.logging — Server-side log entries.
// Mirrors: odoo/addons/base/models/ir_logging.py class IrLogging
//
// Stores structured log entries written by the server,
// accessible via Settings > Technical > Logging.
func initIrLogging() {
m := orm.NewModel("ir.logging", orm.ModelOpts{
Description: "Logging",
Order: "id desc",
})
m.AddFields(
orm.Char("name", orm.FieldOpts{String: "Name", Required: true}),
orm.Selection("type", []orm.SelectionItem{
{Value: "client", Label: "Client"},
{Value: "server", Label: "Server"},
}, orm.FieldOpts{String: "Type", Required: true}),
orm.Char("dbname", orm.FieldOpts{String: "Database Name"}),
orm.Selection("level", []orm.SelectionItem{
{Value: "DEBUG", Label: "Debug"},
{Value: "INFO", Label: "Info"},
{Value: "WARNING", Label: "Warning"},
{Value: "ERROR", Label: "Error"},
{Value: "CRITICAL", Label: "Critical"},
}, orm.FieldOpts{String: "Level"}),
orm.Text("message", orm.FieldOpts{String: "Message", Required: true}),
orm.Char("path", orm.FieldOpts{String: "Path"}),
orm.Char("func", orm.FieldOpts{String: "Function"}),
orm.Char("line", orm.FieldOpts{String: "Line"}),
)
}