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>
This commit is contained in:
72
frontend/sale/static/tests/sales_team_dashboard.test.js
Normal file
72
frontend/sale/static/tests/sales_team_dashboard.test.js
Normal file
@@ -0,0 +1,72 @@
|
||||
import { defineMailModels } from "@mail/../tests/mail_test_helpers";
|
||||
import { expect, test } from "@odoo/hoot";
|
||||
import {
|
||||
contains,
|
||||
defineModels,
|
||||
fields,
|
||||
mockService,
|
||||
models,
|
||||
mountView,
|
||||
onRpc,
|
||||
} from "@web/../tests/web_test_helpers";
|
||||
|
||||
class CRMTeam extends models.Model {
|
||||
_name = "crm.team";
|
||||
|
||||
foo = fields.Char();
|
||||
invoiced = fields.Integer();
|
||||
invoiced_target = fields.Integer();
|
||||
|
||||
_records = [{ id: 1, foo: "yop", invoiced: 0, invoiced_target: 0 }];
|
||||
}
|
||||
|
||||
defineModels([CRMTeam]);
|
||||
defineMailModels();
|
||||
|
||||
test("edit progressbar target", async () => {
|
||||
mockService("action", {
|
||||
doAction(action) {
|
||||
expect(action).toEqual(
|
||||
{
|
||||
res_model: "crm.team",
|
||||
target: "current",
|
||||
type: "ir.actions.act_window",
|
||||
method: "get_formview_action",
|
||||
},
|
||||
{ message: "should trigger do_action with the correct args" }
|
||||
);
|
||||
expect.step("doAction");
|
||||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
onRpc("crm.team", "get_formview_action", ({ method, model }) => ({
|
||||
method,
|
||||
res_model: model,
|
||||
target: "current",
|
||||
type: "ir.actions.act_window",
|
||||
}));
|
||||
|
||||
await mountView({
|
||||
type: "kanban",
|
||||
resModel: "crm.team",
|
||||
arch: /* xml */ `
|
||||
<kanban>
|
||||
<field name="invoiced_target"/>
|
||||
<templates>
|
||||
<div t-name="card">
|
||||
<field name="invoiced" widget="sales_team_progressbar" options="{'current_value': 'invoiced', 'max_value': 'invoiced_target', 'editable': true, 'edit_max_value': true}"/>
|
||||
</div>
|
||||
</templates>
|
||||
</kanban>`,
|
||||
resId: 1,
|
||||
});
|
||||
|
||||
expect(
|
||||
".o_field_sales_team_progressbar:contains(Click to define an invoicing target)"
|
||||
).toHaveCount(1);
|
||||
expect(".o_progressbar input").toHaveCount(0);
|
||||
|
||||
await contains(".sale_progressbar_form_link").click(); // should trigger a do_action
|
||||
expect.verifySteps(["doAction"]);
|
||||
});
|
||||
Reference in New Issue
Block a user