初始提交

This commit is contained in:
2026-11-04 19:58:07 +08:00
commit 53b7d22429
829 changed files with 469986 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

View File

@@ -0,0 +1 @@
<svg width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><path d="M0 12h50v26a4 4 0 0 1-4 4H0V12Z" fill="#03AF89"/><path d="M4 21a4 4 0 0 1-4-4v-5a4 4 0 0 1 4-4h46v9a4 4 0 0 1-4 4H4Z" fill="#FBB945"/><path d="M0 16h50v4a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4v-4Z" fill="#1A6F66"/></svg>

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,45 @@
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { standardWidgetProps } from "@web/views/widgets/standard_widget_props";
import { Component, t, useProps } from "@odoo/owl";
class IAPActionButtonsWidget extends Component {
static template = "iap.ActionButtonsWidget";
props = useProps({
...standardWidgetProps,
serviceName: t.string(),
showServiceButtons: t.boolean(),
label: t.string().optional(),
});
setup() {
this.orm = useService("orm");
this.action = useService("action");
}
async onViewServicesClicked() {
this.action.doAction("iap.iap_account_action");
}
async onManageServiceLinkClicked() {
const account_id = await this.orm.silent.call("iap.account", "get_account_id", [this.props.serviceName]);
this.action.doAction({
type: "ir.actions.act_window",
res_model: "iap.account",
res_id: account_id,
views: [[false, "form"]],
});
}
}
export const iapActionButtonsWidget = {
component: IAPActionButtonsWidget,
extractProps: ({ attrs }) => {
return {
serviceName: attrs.service_name,
showServiceButtons: !Boolean(attrs.hide_service),
label: attrs.label,
};
},
};
registry.category("view_widgets").add("iap_buy_more_credits", iapActionButtonsWidget);

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<template id="template" xml:space="preserve">
<t t-name="iap.ActionButtonsWidget">
<div class="row">
<div class="col-sm">
<button t-on-click="this.onManageServiceLinkClicked" class="btn btn-link px-0 o-hidden-ios text-nowrap"><i class="oi" data-icon="east"/> <t t-if="this.props.label" t-out="this.props.label"/><t t-else="">Manage Service &amp; Buy Credits</t></button><br/>
<button t-if="this.props.showServiceButtons" t-on-click="this.onViewServicesClicked" class="btn btn-link px-0 o-hidden-ios text-nowrap"><i class="oi" data-icon="east"/> View My Services</button>
</div>
</div>
</t>
</template>