Initial commit on branch odoo_DuyDat

This commit is contained in:
Duy Dat
2025-06-13 14:20:29 +07:00
commit 7819a1d6db
228 changed files with 4502 additions and 0 deletions
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Wizard Form View -->
<record id="view_add_employee_wizard_form" model="ir.ui.view">
<field name="name">add.employee.wizard.form</field>
<field name="model">add.employee.wizard</field>
<field name="arch" type="xml">
<form string="Add New Employee">
<group>
<field name="image_1920" widget="image"/>
<field name="name"/>
<field name="email"/>
<field name="phone"/>
<field name="employee_code"/>
<field name="department"/>
<field name="position"/>
</group>
<footer>
<button name="action_add_employee" string="Add Employee" type="object" class="btn-primary"/>
<button string="Cancel" special="cancel"/>
</footer>
</form>
</field>
</record>
<!-- Action mở wizard -->
<record id="action_add_employee_wizard" model="ir.actions.act_window">
<field name="name">Add Employee</field>
<field name="res_model">add.employee.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem id="menu_add_employee"
name="Add Employee"
parent="menu_emplyee_profile"
action="action_add_employee_wizard"/>
</odoo>
@@ -0,0 +1,97 @@
<odoo>
<!-- Kanban View -->
<record id="view_employee_profile_kanban" model="ir.ui.view">
<field name="name">employee.profile.kanban</field>
<field name="model">employee.profile</field>
<field name="arch" type="xml">
<kanban class="o_kanban_example" create="true">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_card d-flex" style="display: flex; align-items: center;">
<!-- Hình ảnh -->
<div class="o_kanban_image" style="height: 100px; width: 100px; flex-shrink: 0;">
<field name="image_1920" widget="image" class="oe_avatar"/>
</div>
<!-- Thông tin chi tiết -->
<div class="o_kanban_details" style="padding-left: 10px; flex: 1;">
<strong>
<field name="name"/>
</strong>
<div>
<field name="employee_code"/>
</div>
<div>
<field name="email"/>
</div>
<div>
<field name="phone"/>
</div>
<div>
<field name="department"/>
</div>
<div>
<field name="position"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_employee_list_custom" model="ir.ui.view">
<field name="name">employee.profile.list</field>
<field name="model">employee.profile</field> <!-- Đổi model nếu không phải employee.profile -->
<field name="arch" type="xml">
<list string="Employees">
<field name="name"/>
<field name="employee_code"/>
<field name="email"/>
<field name="phone"/>
<field name="department"/>
<field name="position"/>
<field name="image_1920" widget="image" class="oe_avatar"/>
</list>
</field>
</record>
<record id="view_employee_profile_form" model="ir.ui.view">
<field name="name">employee.profile.form</field>
<field name="model">employee.profile</field>
<field name="arch" type="xml">
<form string="Employee Profile" group="employee_management.group_employee_admin">
<header>
<button name="%(report_employee_profile)d" string="Print Profile" type="action" class="oe_highlight"/>
</header>
<sheet style="max-width: 50%; margin: auto;">
<group col="2">
<group style="width:20%;">
<field name="image_1920" widget="image" nolabel="1" class="oe_avatar" options="{'preview_image': 'image_1920'}"/>
</group>
<group style="flex: 1;">
<field name="name"/>
<field name="employee_code"/>
<field name="email"/>
<field name="phone"/>
<field name="department"/>
<field name="position"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- Action -->
<record id="action_employee_profile" model="ir.actions.act_window">
<field name="name">Employee Profiles</field>
<field name="res_model">employee.profile</field>
<field name="view_mode">kanban,list,form</field>
<field name="views" eval="[
(ref('view_employee_profile_kanban'), 'kanban'),
(ref('view_employee_list_custom'), 'list')
]"/>
</record>
</odoo>
@@ -0,0 +1,61 @@
<odoo>
<!-- QWeb Report Template -->
<template id="report_employee_profile_template">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<h2 style="text-align: center;">Employee Profile Report</h2>
<table class="table table-sm table-bordered" style="width: 100%; border-collapse: collapse;" border="1">
<thead style="background-color: #f2f2f2;">
<tr>
<th>Name</th>
<th>Employee Code</th>
<th>Email</th>
<th>Phone</th>
<th>Department</th>
<th>Position</th>
<th>Image</th>
</tr>
</thead>
<tbody>
<t t-foreach="docs" t-as="doc">
<tr>
<td>
<t t-esc="doc.name"/>
</td>
<td>
<t t-esc="doc.employee_code"/>
</td>
<td>
<t t-esc="doc.email"/>
</td>
<td>
<t t-esc="doc.phone"/>
</td>
<td>
<t t-esc="doc.department"/>
</td>
<td>
<t t-esc="doc.position"/>
</td>
</tr>
</t>
</tbody>
</table>
</div>
</t>
</t>
</template>
<!-- Report Action -->
<record id="report_employee_profile" model="ir.actions.report">
<field name="name">Employee Profile Report</field>
<field name="model">employee.profile</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">employee_management.report_employee_profile_template</field>
<field name="report_file">employee_management.report_employee_profile_template</field>
<field name="print_report_name">'EmployeeProfile_' + (object.name or '')</field>
</record>
</odoo>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Menu Gốc -->
<menuitem id="menu_employee_root" name="Employee Management" sequence="10"/>
<menuitem id="menu_emplyee_profile" name="Profiles" parent="menu_employee_root" action="action_employee_profile"/>
<menuitem id="menu_employee_add" name="Add Employee" parent="menu_employee_root" action="employee_management.action_add_employee_wizard"/>
</odoo>