first push message
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
# from . import models
|
||||
from . import controllers
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
'name': 'Document Approval Extension',
|
||||
'version': '1.0',
|
||||
'category': 'Document Management',
|
||||
'summary': 'Document Package Management with Metabase Analytics',
|
||||
'author': 'Your Company',
|
||||
'license': 'LGPL-3',
|
||||
'depends': ['base', 'web'],
|
||||
'data': [
|
||||
# 'views/document_package_views.xml', # Re-enabled
|
||||
'views/metabase_dashboard_views.xml',
|
||||
'views/metabase_template.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
from . import main # ✅ CORRECT
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
|
||||
class MetabaseDashboard(http.Controller):
|
||||
|
||||
@http.route('/metabase/dashboard', auth='user', type='http', csrf=False)
|
||||
def metabase_dashboard(self, **kwargs):
|
||||
return request.render('xf_doc_approval_extension.metabase_dashboard_page')
|
||||
@@ -0,0 +1 @@
|
||||
from . import document_package
|
||||
@@ -0,0 +1,5 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
class DocumentPackage(models.Model):
|
||||
_name = 'xf.doc.approval.document.package'
|
||||
_description = 'Document Package'
|
||||
@@ -0,0 +1,22 @@
|
||||
odoo.define('xf_doc_approval_extension.metabase_dashboard', function (require) {
|
||||
"use strict";
|
||||
|
||||
var AbstractAction = require('web.AbstractAction');
|
||||
var core = require('web.core');
|
||||
|
||||
var MetabaseDashboard = AbstractAction.extend({
|
||||
template: 'metabase_dashboard_template',
|
||||
|
||||
start: function () {
|
||||
var self = this;
|
||||
return this._super.apply(this, arguments).then(function () {
|
||||
// You can add custom JavaScript here if needed
|
||||
console.log('Metabase Dashboard Loaded');
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
core.action_registry.add('metabase_dashboard_widget', MetabaseDashboard);
|
||||
|
||||
return MetabaseDashboard;
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="assets_backend" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/xf_doc_approval_extension/static/src/js/metabase_widget.js"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Force this as the MAIN form view -->
|
||||
<record id="document_package_form_project_view" model="ir.ui.view">
|
||||
<field name="name">Document Package Form - Project View</field>
|
||||
<field name="model">xf.doc.approval.document.package</field>
|
||||
<field name="priority" eval="1000"/> <!-- ខ្ពស់បំផុត -->
|
||||
<field name="mode">primary</field> <!-- សំខាន់បំផុត -->
|
||||
<field name="arch" type="xml">
|
||||
<form string="សំណើសុំអនុម័ត">
|
||||
|
||||
<sheet>
|
||||
|
||||
<!-- Project Management Header -->
|
||||
<group string="I. សេវាកម្មគ្រប់គ្រងគម្រោង" colspan="2">
|
||||
<field name="stage_id" widget="statusbar" clickable="1"/>
|
||||
<field name="progress" widget="progressbar" options="{'editable': true}"/>
|
||||
<field name="responsible_user_id" string="អ្នកទទួលខុសត្រូវ"/>
|
||||
</group>
|
||||
|
||||
<!-- Main Content Area -->
|
||||
<group string="២. របាយការណ៍ស្ថានភាពការងារ" colspan="2">
|
||||
<field name="description" widget="html" options="{'height': 450}"/>
|
||||
</group>
|
||||
|
||||
</sheet>
|
||||
|
||||
<!-- Chatter (Send message, Log note, Activity) -->
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="action_metabase_analytics" model="ir.actions.act_url">
|
||||
<field name="name">Metabase Analytics</field>
|
||||
<field name="url">/metabase/dashboard</field>
|
||||
<field name="target">self</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_metabase_root"
|
||||
name="Analytics"
|
||||
sequence="50"/>
|
||||
|
||||
<menuitem id="menu_metabase_dashboard"
|
||||
name="Dashboard"
|
||||
parent="menu_metabase_root"
|
||||
action="action_metabase_analytics"
|
||||
sequence="10"/>
|
||||
</odoo>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="metabase_dashboard_page" name="Metabase Dashboard">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>ផ្ទាំងគ្រប់គ្រងការងារ</title>
|
||||
|
||||
<!-- Import Khmer OS Battambang Font -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com"/>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""/>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Battambang:wght@100;300;400;700;900&display=swap" rel="stylesheet"/>
|
||||
|
||||
<style>
|
||||
/* Khmer Font */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Battambang', 'Khmer OS Battambang', 'Khmer OS', sans-serif !important;
|
||||
}
|
||||
|
||||
/* Dark Mode */
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background-color: #1a1d1f;
|
||||
}
|
||||
|
||||
/* Dashboard Container */
|
||||
.dashboard-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
background-color: #1a1d1f;
|
||||
}
|
||||
|
||||
/* Header with Dark Purple Gradient */
|
||||
.dashboard-header {
|
||||
background: linear-gradient(135deg, #4a2c5c 0%, #6b3d7a 100%);
|
||||
padding: 20px 30px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.dashboard-title {
|
||||
color: #ffffff;
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
font-family: 'Battambang', 'Khmer OS Battambang', sans-serif !important;
|
||||
}
|
||||
|
||||
.title-icon {
|
||||
font-size: 32px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* Content Area */
|
||||
.dashboard-content {
|
||||
flex: 1;
|
||||
padding: 16px;
|
||||
background-color: #1a1d1f;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Iframe Container with Dark Border */
|
||||
.iframe-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
|
||||
background: #2d3136;
|
||||
}
|
||||
|
||||
/* Iframe */
|
||||
iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
display: block;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 768px) {
|
||||
.dashboard-header {
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
.dashboard-title {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.title-icon {
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.dashboard-content {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="dashboard-wrapper">
|
||||
<!-- Dark Header with Khmer Title -->
|
||||
<div class="dashboard-header">
|
||||
<h1 class="dashboard-title">
|
||||
<span class="title-icon">📊</span>
|
||||
ផ្ទាំងគ្រប់គ្រងការងារ
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<!-- Dashboard Content -->
|
||||
<div class="dashboard-content">
|
||||
<div class="iframe-container">
|
||||
<iframe src="https://dashboard.des.gov.kh"
|
||||
allowfullscreen="true"
|
||||
loading="lazy">
|
||||
</iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user