Files
goodie/frontend/project/static/tests/project_task_project_many2one_field.test.js
Marc 8741282322 Eliminate Python dependency: embed frontend assets in odoo-go
- Copy all OWL frontend assets (JS/CSS/XML/fonts/images) into frontend/
  directory (2925 files, 43MB) — no more runtime reads from Python Odoo
- Replace OdooAddonsPath config with FrontendDir pointing to local frontend/
- Rewire bundle.go, static.go, templates.go, webclient.go to read from
  frontend/ instead of external Python Odoo addons directory
- Auto-detect frontend/ and build/ dirs relative to binary in main.go
- Delete obsolete Python helper scripts (tools/*.py)

The Go server is now fully self-contained: single binary + frontend/ folder.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:09:12 +02:00

41 lines
1.3 KiB
JavaScript

import { expect, test } from "@odoo/hoot";
import { mountView } from "@web/../tests/web_test_helpers";
import { defineProjectModels } from "./project_models";
defineProjectModels();
test("ProjectMany2one: project.task form view with private task", async () => {
await mountView({
resModel: "project.task",
resId: 3,
type: "form",
arch: `
<form>
<field name="name"/>
<field name="project_id" widget="project"/>
</form>
`,
});
expect("div[name='project_id'] .o_many2one").toHaveClass("o_many2one private_placeholder w-100");
expect("div[name='project_id'] .o_many2one input").toHaveAttribute("placeholder", "Private");
});
test("ProjectMany2one: project.task list view", async () => {
await mountView({
resModel: "project.task",
type: "list",
arch: `
<list>
<field name="name"/>
<field name="project_id" widget="project"/>
</list>
`,
});
expect("div[name='project_id']").toHaveCount(3);
expect("div[name='project_id'] .o_many2one").toHaveCount(2);
expect("div[name='project_id'] span.text-danger.fst-italic.text-muted").toHaveCount(1);
expect("div[name='project_id'] span.text-danger.fst-italic.text-muted").toHaveText("🔒 Private");
});