Bring all areas to 60%: modules, reporting, i18n, views, data

Business modules deepened:
- sale: tag_ids, invoice/delivery counts with computes
- stock: _action_confirm/_action_done on stock.move, quant update stub
- purchase: done state added
- hr: parent_id, address_home_id, no_of_recruitment
- project: user_id, date_start, kanban_state on tasks

Reporting framework (0% → 60%):
- ir.actions.report model registered
- /report/html/<name>/<ids> endpoint serves styled HTML reports
- Report-to-model mapping for invoice, sale, stock, purchase

i18n framework (0% → 60%):
- ir.translation model with src/value/lang/type fields
- handleTranslations loads from DB, returns per-module structure
- 140 German translations seeded (UI terms across all modules)
- res_lang seeded with en_US + de_DE

Views/UI improved:
- Stored form views: sale.order (with editable O2M lines), account.move
  (with Post/Cancel buttons), res.partner (with title)
- Stored list views: purchase.order, hr.employee, project.project

Demo data expanded:
- 5 products (templates + variants with codes)
- 3 HR departments, 3 employees
- 2 projects

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc
2026-04-02 20:11:45 +02:00
parent eb92a2e239
commit 03fd58a852
13 changed files with 944 additions and 31 deletions

View File

@@ -20,4 +20,6 @@ func Init() {
initIrCron() // ir.cron (Scheduled Actions)
initResLang() // res.lang (Languages)
initResConfigSettings() // res.config.settings (TransientModel)
initIrActionsReport() // ir.actions.report (Report Actions)
initIrTranslation() // ir.translation (Translations)
}

View File

@@ -0,0 +1,32 @@
package models
import "odoo-go/pkg/orm"
// initIrActionsReport registers ir.actions.report — Report Action definitions.
// Mirrors: odoo/addons/base/models/ir_actions_report.py class IrActionsReport
//
// Report actions define how to generate reports for records.
// The default report_type is "qweb-html" which renders HTML in the browser.
func initIrActionsReport() {
m := orm.NewModel("ir.actions.report", orm.ModelOpts{
Description: "Report Action",
Table: "ir_act_report",
Order: "name",
})
m.AddFields(
orm.Char("name", orm.FieldOpts{String: "Name", Required: true}),
orm.Char("type", orm.FieldOpts{String: "Action Type", Default: "ir.actions.report"}),
orm.Char("report_name", orm.FieldOpts{String: "Report Name", Required: true}),
orm.Char("report_type", orm.FieldOpts{String: "Report Type", Default: "qweb-html"}),
orm.Many2one("model_id", "ir.model", orm.FieldOpts{String: "Model"}),
orm.Char("model", orm.FieldOpts{String: "Model Name"}),
orm.Boolean("multi", orm.FieldOpts{String: "On Multiple Docs"}),
orm.Many2one("paperformat_id", "report.paperformat", orm.FieldOpts{String: "Paper Format"}),
orm.Char("print_report_name", orm.FieldOpts{String: "Printed Report Name"}),
orm.Boolean("attachment_use", orm.FieldOpts{String: "Reload from Attachment"}),
orm.Char("attachment", orm.FieldOpts{String: "Save as Attachment Prefix"}),
orm.Many2many("groups_id", "res.groups", orm.FieldOpts{String: "Groups"}),
orm.Char("binding_type", orm.FieldOpts{String: "Binding Type", Default: "report"}),
)
}

View File

@@ -0,0 +1,34 @@
package models
import "odoo-go/pkg/orm"
// initIrTranslation registers ir.translation — Translation storage.
// Mirrors: odoo/addons/base/models/ir_translation.py class IrTranslation
//
// Stores translated strings for model fields, code terms, and structured terms.
// The web client loads translations via /web/webclient/translations and uses them
// to render UI elements in the user's language.
func initIrTranslation() {
m := orm.NewModel("ir.translation", orm.ModelOpts{
Description: "Translation",
Order: "lang, name",
})
m.AddFields(
orm.Char("name", orm.FieldOpts{String: "Translated field", Required: true, Index: true}),
orm.Char("res_id", orm.FieldOpts{String: "Record ID"}),
orm.Char("lang", orm.FieldOpts{String: "Language", Required: true, Index: true}),
orm.Selection("type", []orm.SelectionItem{
{Value: "model", Label: "Model Field"},
{Value: "model_terms", Label: "Structured Model Field"},
{Value: "code", Label: "Code"},
}, orm.FieldOpts{String: "Type", Index: true}),
orm.Text("src", orm.FieldOpts{String: "Source"}),
orm.Text("value", orm.FieldOpts{String: "Translation Value"}),
orm.Char("module", orm.FieldOpts{String: "Module"}),
orm.Selection("state", []orm.SelectionItem{
{Value: "to_translate", Label: "To Translate"},
{Value: "translated", Label: "Translated"},
}, orm.FieldOpts{String: "Status", Default: "to_translate"}),
)
}