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:
@@ -0,0 +1,41 @@
|
||||
import { Component, onWillStart } from "@odoo/owl";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { user } from "@web/core/user";
|
||||
import { ConfirmationDialog, deleteConfirmationMessage } from "@web/core/confirmation_dialog/confirmation_dialog";
|
||||
|
||||
export class ProjectTemplateButtons extends Component {
|
||||
static template = "project.ProjectTemplateButtons";
|
||||
static props = {
|
||||
resModel: String,
|
||||
resId: Number,
|
||||
};
|
||||
|
||||
setup() {
|
||||
this.orm = useService("orm");
|
||||
this.dialogService = useService("dialog");
|
||||
this.action = useService("action");
|
||||
onWillStart(async () => {
|
||||
this.isProjectManager = await user.hasGroup('project.group_project_manager');
|
||||
});
|
||||
}
|
||||
|
||||
onEditClick() {
|
||||
this.action.doAction({
|
||||
type: "ir.actions.act_window",
|
||||
res_model: this.props.resModel,
|
||||
res_id: this.props.resId,
|
||||
views: [[false, "form"]],
|
||||
});
|
||||
}
|
||||
|
||||
async onDeleteClick() {
|
||||
this.dialogService.add(ConfirmationDialog, {
|
||||
body: deleteConfirmationMessage,
|
||||
confirm: async () => {
|
||||
await this.orm.unlink(this.props.resModel, [this.props.resId]);
|
||||
this.action.doAction("soft_reload");
|
||||
},
|
||||
cancel: () => {},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user