ok
This commit is contained in:
parent
37a29392e0
commit
1925d8dd44
@ -9,21 +9,12 @@
|
||||
'website': 'https://minhng.info',
|
||||
'category': 'Uncategorized', # https://github.com/odoo/odoo/blob/18.0/odoo/addons/base/data/ir_module_category_data.xml
|
||||
'version': '0.1',
|
||||
'depends': [
|
||||
'product',
|
||||
],
|
||||
'data': [],
|
||||
'demo': [],
|
||||
'css': [],
|
||||
# 'qweb': ['static/src/xml/*.xml'],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'application': True,
|
||||
|
||||
# Depends declaration
|
||||
|
||||
# Dependencies
|
||||
'depends': [
|
||||
'product',
|
||||
'mail',
|
||||
'hr',
|
||||
],
|
||||
|
||||
# Data files declaration
|
||||
@ -38,6 +29,13 @@
|
||||
'wizard/toy_add_views.xml',
|
||||
'wizard/cage_update_views.xml',
|
||||
'wizard/animal_feeding_views.xml',
|
||||
'views/zoo_husbandry_task_views.xml'
|
||||
'views/zoo_husbandry_task_views.xml',
|
||||
'views/zoo_keeper_views.xml',
|
||||
'views/zoo_keeper_certificate_views.xml',
|
||||
'views/zoo_keeper_speciality_views.xml',
|
||||
],
|
||||
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'application': True,
|
||||
}
|
||||
11
addons/zoo/demo/1_zoo_keeper_speciality.csv
Normal file
11
addons/zoo/demo/1_zoo_keeper_speciality.csv
Normal file
@ -0,0 +1,11 @@
|
||||
id,name,description
|
||||
speciality_reptile,Reptile Care Specialist,Expertise in caring for snakeslizardsturtles and other reptiles
|
||||
speciality_mammal,Mammal Care Specialist,Expertise in caring for large and small mammals
|
||||
speciality_bird,Avian Care Specialist,Expertise in caring for birds and aviaries
|
||||
speciality_aquatic,Aquatic Animal Specialist,Expertise in caring for fishamphibians and marine life
|
||||
speciality_primate,Primate Behavior Specialist,Expertise in primate care and behavioral enrichment
|
||||
speciality_carnivore,Large Carnivore Specialist,Expertise in caring for big catsbears and other carnivores
|
||||
speciality_herbivore,Herbivore Nutrition Specialist,Expertise in herbivore diet planning and nutrition
|
||||
speciality_nocturnal,Nocturnal Animal Specialist,Expertise in caring for nocturnal species
|
||||
speciality_exotic,Exotic Species Specialist,Expertise in rare and exotic animal care
|
||||
speciality_veterinary,Veterinary Assistant,Expertise in animal health monitoring and medical support
|
||||
|
16
addons/zoo/demo/2_hr_employee_keepers.csv
Normal file
16
addons/zoo/demo/2_hr_employee_keepers.csv
Normal file
@ -0,0 +1,16 @@
|
||||
id,name,is_zoo_keeper,work_email,mobile_phone,speciality_ids/id
|
||||
keeper_sarah_chen,Sarah Chen,TRUE,sarah.chen@zoo.com,+1-555-0101,"speciality_reptile,speciality_exotic"
|
||||
keeper_james_rodriguez,James Rodriguez,TRUE,james.rodriguez@zoo.com,+1-555-0102,"speciality_mammal,speciality_carnivore"
|
||||
keeper_emily_watson,Emily Watson,TRUE,emily.watson@zoo.com,+1-555-0103,speciality_bird
|
||||
keeper_michael_okonkwo,Michael Okonkwo,TRUE,michael.okonkwo@zoo.com,+1-555-0104,"speciality_primate,speciality_veterinary"
|
||||
keeper_lisa_nguyen,Lisa Nguyen,TRUE,lisa.nguyen@zoo.com,+1-555-0105,speciality_aquatic
|
||||
keeper_david_patel,David Patel,TRUE,david.patel@zoo.com,+1-555-0106,speciality_herbivore
|
||||
keeper_anna_kowalski,Anna Kowalski,TRUE,anna.kowalski@zoo.com,+1-555-0107,"speciality_nocturnal,speciality_reptile"
|
||||
keeper_robert_smith,Robert Smith,TRUE,robert.smith@zoo.com,+1-555-0108,speciality_carnivore
|
||||
keeper_maria_santos,Maria Santos,TRUE,maria.santos@zoo.com,+1-555-0109,"speciality_bird,speciality_exotic"
|
||||
keeper_william_jones,William Jones,TRUE,william.jones@zoo.com,+1-555-0110,speciality_mammal
|
||||
keeper_sofia_garcia,Sofia Garcia,TRUE,sofia.garcia@zoo.com,+1-555-0111,speciality_primate
|
||||
keeper_thomas_mueller,Thomas Mueller,TRUE,thomas.mueller@zoo.com,+1-555-0112,"speciality_veterinary,speciality_aquatic"
|
||||
keeper_olivia_brown,Olivia Brown,TRUE,olivia.brown@zoo.com,+1-555-0113,"speciality_herbivore,speciality_mammal"
|
||||
keeper_daniel_kim,Daniel Kim,TRUE,daniel.kim@zoo.com,+1-555-0114,speciality_exotic
|
||||
keeper_isabella_rossi,Isabella Rossi,TRUE,isabella.rossi@zoo.com,+1-555-0115,"speciality_nocturnal,speciality_bird"
|
||||
|
18
addons/zoo/demo/3_zoo_keeper_certification.csv
Normal file
18
addons/zoo/demo/3_zoo_keeper_certification.csv
Normal file
@ -0,0 +1,18 @@
|
||||
id,certificate_code,name,employee_id/id,issue_date,expiry_date,description
|
||||
cert_sarah_1,CERT-2023-001,Advanced Reptile Handling,keeper_sarah_chen,2023-01-15,2026-01-15,Certified in safe handling of venomous and non-venomous reptiles
|
||||
cert_james_1,CERT-2023-002,Big Cat Safety Protocol,keeper_james_rodriguez,2023-02-20,2025-02-20,Certified in safe working practices around large carnivores
|
||||
cert_emily_1,CERT-2023-003,Avian Health Management,keeper_emily_watson,2023-03-10,2026-03-10,Certified in bird disease prevention and health monitoring
|
||||
cert_michael_1,CERT-2023-004,Primate Enrichment Specialist,keeper_michael_okonkwo,2023-04-05,2026-04-05,Certified in behavioral enrichment for primates
|
||||
cert_lisa_1,CERT-2023-005,Aquatic Life Support Systems,keeper_lisa_nguyen,2023-05-12,2026-05-12,Certified in aquarium and aquatic system management
|
||||
cert_david_1,CERT-2023-006,Herbivore Nutrition Certificate,keeper_david_patel,2023-06-18,2026-06-18,Certified in specialized diets for herbivorous animals
|
||||
cert_anna_1,CERT-2023-007,Nocturnal Species Care,keeper_anna_kowalski,2023-07-22,2026-07-22,Certified in care and management of nocturnal animals
|
||||
cert_robert_1,CERT-2023-008,Wildlife First Aid,keeper_robert_smith,2023-08-30,2025-08-30,Certified in emergency first aid for exotic animals
|
||||
cert_maria_1,CERT-2023-009,Exotic Bird Training,keeper_maria_santos,2023-09-14,2026-09-14,Certified in positive reinforcement training for exotic birds
|
||||
cert_william_1,CERT-2023-010,Large Mammal Husbandry,keeper_william_jones,2023-10-08,2026-10-08,Certified in care and management of large mammals
|
||||
cert_sofia_1,CERT-2023-011,Primate Health Monitoring,keeper_sofia_garcia,2023-11-19,2026-11-19,Certified in primate health assessment and monitoring
|
||||
cert_thomas_1,CERT-2023-012,Veterinary Assistant Wildlife,keeper_thomas_mueller,2023-12-05,2025-12-05,Certified veterinary assistant for exotic animals
|
||||
cert_olivia_1,CERT-2024-001,Animal Nutrition Specialist,keeper_olivia_brown,2024-01-20,2027-01-20,Certified in zoo animal nutrition and diet formulation
|
||||
cert_daniel_1,CERT-2024-002,Exotic Species Conservation,keeper_daniel_kim,2024-02-28,2027-02-28,Certified in conservation breeding programs for exotic species
|
||||
cert_isabella_1,CERT-2024-003,Wildlife Behavior Analysis,keeper_isabella_rossi,2024-03-15,2027-03-15,Certified in animal behavior observation and analysis
|
||||
cert_sarah_2,CERT-2024-004,Exotic Animal Transport,keeper_sarah_chen,2024-04-10,2026-04-10,Certified in safe transport of exotic reptiles
|
||||
cert_james_2,CERT-2024-005,Animal CPR and Emergency Response,keeper_james_rodriguez,2024-05-22,2025-05-22,Certified in emergency medical response for zoo animals
|
||||
|
@ -5,4 +5,5 @@ from . import zoo_health_record
|
||||
from . import zoo_diet_plan
|
||||
from . import zoo_diet_line
|
||||
from . import zoo_animal_meal
|
||||
from . import zoo_husbandry_task
|
||||
from . import zoo_husbandry_task
|
||||
from . import zoo_keeper
|
||||
Binary file not shown.
BIN
addons/zoo/models/__pycache__/zoo_keeper.cpython-312.pyc
Normal file
BIN
addons/zoo/models/__pycache__/zoo_keeper.cpython-312.pyc
Normal file
Binary file not shown.
102
addons/zoo/models/zoo_keeper.py
Normal file
102
addons/zoo/models/zoo_keeper.py
Normal file
@ -0,0 +1,102 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 1. MAIN MODEL: KEEPER (Inherit from HR Employee)
|
||||
# ---------------------------------------------------------
|
||||
class ZooKeeper(models.Model):
|
||||
_inherit = 'hr.employee'
|
||||
_description = 'Zoo Keeper Management'
|
||||
|
||||
# flag để phân biệt Employee nào là Zoo Keepers
|
||||
is_zoo_keeper = fields.Boolean(string='Is Zoo Keeper',
|
||||
default=False)
|
||||
|
||||
# Quan hệ với class con: Speciality (Many2many vì có thể share giữa nhiều keepers)
|
||||
speciality_ids = fields.Many2many(
|
||||
comodel_name='zoo.keeper.speciality',
|
||||
relation='zoo_keeper_speciality_rel',
|
||||
column1='employee_id',
|
||||
column2='speciality_id',
|
||||
string='Specialities',
|
||||
help='Species or families this keeper specializes in.')
|
||||
|
||||
# Quan hệ với class con: Certification (One2many vì mỗi cert là unique)
|
||||
certification_ids = fields.One2many(
|
||||
comodel_name='zoo.keeper.certification',
|
||||
inverse_name='employee_id',
|
||||
string='Certifications',
|
||||
help='Certifications this keeper has.')
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 2. SATELLITE MODELS (Master Data)
|
||||
# ---------------------------------------------------------
|
||||
|
||||
class ZooKeeperSpeciality(models.Model):
|
||||
_name = 'zoo.keeper.speciality'
|
||||
_description = 'Zoo Keeper Speciality'
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
name = fields.Char(string='Name',
|
||||
required=True)
|
||||
|
||||
description = fields.Text(string='Description')
|
||||
|
||||
# Quan hệ ngược: Many2many với hr.employee
|
||||
employee_ids = fields.Many2many(
|
||||
comodel_name='hr.employee',
|
||||
relation='zoo_keeper_speciality_rel',
|
||||
column1='speciality_id',
|
||||
column2='employee_id',
|
||||
string='Keepers',
|
||||
help='Keepers who have this speciality')
|
||||
|
||||
class ZooKeeperCertification(models.Model):
|
||||
_name = 'zoo.keeper.certification'
|
||||
_description = 'Zoo Keeper Certification'
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
# Tạo số chứng chỉ
|
||||
certificate_code = fields.Char(
|
||||
string='Certificate Code',
|
||||
required=True,
|
||||
copy=False, # Không copy khi duplicate
|
||||
help='Unique certificate number')
|
||||
|
||||
name = fields.Char(string='Name',
|
||||
required=True)
|
||||
|
||||
description = fields.Text(string='Description')
|
||||
|
||||
# Link ngược về Employee
|
||||
employee_id = fields.Many2one(comodel_name='hr.employee',
|
||||
string='Keeper',
|
||||
required=True,
|
||||
ondelete='cascade')
|
||||
|
||||
issue_date = fields.Date(string='Issue Date')
|
||||
|
||||
expiry_date = fields.Date(string='Expiry Date')
|
||||
|
||||
# File scan chứng chỉ
|
||||
attachment = fields.Binary(string='Certificate Document')
|
||||
|
||||
# Computed field để cảnh báo hết hạn
|
||||
is_expired = fields.Boolean(compute='_compute_is_expired',
|
||||
string='Expired Date')
|
||||
|
||||
# Computed field để cảnh báo hết hạn
|
||||
@api.depends('expiry_date')
|
||||
def _compute_is_expired(self):
|
||||
today = fields.Date.today()
|
||||
for record in self:
|
||||
if record.expiry_date and record.expiry_date < today:
|
||||
record.is_expired = True
|
||||
else:
|
||||
record.is_expired = False
|
||||
|
||||
# SQL Constraint để đảm bảo Certificate code là unique
|
||||
_sql_constraints = [
|
||||
('certificate_code_unique',
|
||||
'UNIQUE(certificate_code)',
|
||||
'Certificate Code must be unique!')
|
||||
]
|
||||
@ -12,4 +12,6 @@ access_zoo_animal_feeding_wizard,access_zoo_animal_feeding_wizard,model_zoo_anim
|
||||
access_zoo_animal_feeding_wizard_line,access_zoo_animal_feeding_wizard_line,model_zoo_animal_feeding_wizard_line,base.group_user,1,1,1,1
|
||||
access_zoo_husbandry_task,access_zoo_husbandry_task,model_zoo_husbandry_task,base.group_user,1,1,1,1
|
||||
access_zoo_husbandry_task_line,access_zoo_husbandry_task_line,model_zoo_husbandry_task_line,base.group_user,1,1,1,1
|
||||
access_zoo_cage_checklist_template,access_zoo_cage_checklist_template,model_zoo_cage_checklist_template,base.group_user,1,1,1,1
|
||||
access_zoo_cage_checklist_template,access_zoo_cage_checklist_template,model_zoo_cage_checklist_template,base.group_user,1,1,1,1
|
||||
access_zoo_keeper_speciality,access_zoo_keeper_speciality,model_zoo_keeper_speciality,base.group_user,1,1,1,1
|
||||
access_zoo_keeper_certification,access_zoo_keeper_certification,model_zoo_keeper_certification,base.group_user,1,1,1,1
|
||||
|
97
addons/zoo/views/zoo_keeper_certificate_views.xml
Normal file
97
addons/zoo/views/zoo_keeper_certificate_views.xml
Normal file
@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- Định nghĩa Form view -->
|
||||
<record id="zoo_keeper_certification_form_view" model="ir.ui.view">
|
||||
<field name="name">zoo.keeper.certification.form.view</field>
|
||||
<field name="model">zoo.keeper.certification</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<field name="is_expired" invisible="1"/>
|
||||
<button string="Expired" class="oe_read_only btn-danger"
|
||||
invisible="not is_expired"
|
||||
icon="fa-exclamation-triangle"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name" placeholder="e.g. Wildlife Safety Certification"/></h1>
|
||||
</div>
|
||||
|
||||
<group>
|
||||
<group>
|
||||
<field name="certificate_code" placeholder="e.g. CERT-2024-001"/>
|
||||
<field name="employee_id"
|
||||
domain="[('is_zoo_keeper', '=', True)]"
|
||||
context="{'default_is_zoo_keeper': True}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="issue_date"/>
|
||||
<field name="expiry_date"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<field name="description" placeholder="Additional certification details..."/>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<field name="attachment"
|
||||
widget="binary"
|
||||
filename="name"
|
||||
string="Upload Certificate Document"/>
|
||||
</group>
|
||||
</sheet>
|
||||
|
||||
<chatter reload_on_post="True"/>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Định nghĩa List view -->
|
||||
<record id="zoo_keeper_certification_list_view" model="ir.ui.view">
|
||||
<field name="name">zoo.keeper.certification.list.view</field>
|
||||
<field name="model">zoo.keeper.certification</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Certifications" default_order="expiry_date asc">
|
||||
<field name="certificate_code"/>
|
||||
<field name="name"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="issue_date"/>
|
||||
<field name="expiry_date"/>
|
||||
<field name="is_expired"
|
||||
widget="boolean_toggle"
|
||||
decoration-danger="is_expired == True"
|
||||
readonly="1"/>
|
||||
<field name="attachment" widget="binary" filename="name"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Định nghĩa Action -->
|
||||
<record id="action_zoo_keeper_certification" model="ir.actions.act_window">
|
||||
<field name="name">Certifications</field>
|
||||
<field name="res_model">zoo.keeper.certification</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Add a new Certification
|
||||
</p>
|
||||
<p>
|
||||
Track keeper certifications, issue and expiry dates.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Định nghĩa menu item Certification -->
|
||||
<menuitem id="menu_zoo_keeper_certification"
|
||||
name="Certifications"
|
||||
action="action_zoo_keeper_certification"
|
||||
sequence="20"
|
||||
parent="menu_zoo_keepers_management"
|
||||
groups="base.group_user"/>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
80
addons/zoo/views/zoo_keeper_speciality_views.xml
Normal file
80
addons/zoo/views/zoo_keeper_speciality_views.xml
Normal file
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- Định nghĩa Form view -->
|
||||
<record id="zoo_keeper_speciality_form_view" model="ir.ui.view">
|
||||
<field name="name">zoo.keeper.speciality.form.view</field>
|
||||
<field name="model">zoo.keeper.speciality</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name" placeholder="e.g. Reptile Specialist"/></h1>
|
||||
</div>
|
||||
|
||||
<group>
|
||||
<field name="description"
|
||||
placeholder="Description of this speciality..."
|
||||
nolabel="1"/>
|
||||
</group>
|
||||
|
||||
<notebook>
|
||||
<page string="Keepers with this Speciality" name="keepers">
|
||||
<field name="employee_ids"
|
||||
domain="[('is_zoo_keeper', '=', True)]"
|
||||
context="{'default_is_zoo_keeper': True}">
|
||||
<list>
|
||||
<field name="name"/>
|
||||
<field name="work_email"/>
|
||||
<field name="mobile_phone"/>
|
||||
<field name="department_id"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
||||
<chatter reload_on_post="True"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Định nghĩa List view -->
|
||||
<record id="zoo_keeper_speciality_list_view" model="ir.ui.view">
|
||||
<field name="name">zoo.keeper.speciality.list.view</field>
|
||||
<field name="model">zoo.keeper.speciality</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Specialities">
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
<field name="employee_ids" widget="many2many_tags"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Định nghĩa Action -->
|
||||
<record id="action_zoo_keeper_speciality" model="ir.actions.act_window">
|
||||
<field name="name">Specialities</field>
|
||||
<field name="res_model">zoo.keeper.speciality</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Add a new Speciality
|
||||
</p>
|
||||
<p>
|
||||
Create keeper specialities like Reptile Care, Mammal Care, etc.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Định nghĩa menu item Speciality -->
|
||||
<menuitem id="menu_zoo_keeper_speciality"
|
||||
name="Specialities"
|
||||
action="action_zoo_keeper_speciality"
|
||||
sequence="30"
|
||||
parent="menu_zoo_keepers_management"
|
||||
groups="base.group_user"/>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
86
addons/zoo/views/zoo_keeper_views.xml
Normal file
86
addons/zoo/views/zoo_keeper_views.xml
Normal file
@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- Định nghĩa Form view -->
|
||||
<record id="view_employee_form_zoo_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.employee.form.zoo.inherit</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="inherit_id" ref="hr.view_employee_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<xpath expr="//field[@name='category_ids']" position="after">
|
||||
<field name="is_zoo_keeper" widget="boolean_toggle"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page string="Zoo Qualifications" invisible="not is_zoo_keeper">
|
||||
<group>
|
||||
<group string="Expertise">
|
||||
<field name="speciality_ids" widget="many2many_tags"
|
||||
options="{'no_create_edit': True}"
|
||||
placeholder="Select specialities..."/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<separator string="Certifications"/>
|
||||
<field name="certification_ids">
|
||||
<list editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="certificate_code"/>
|
||||
<field name="issue_date"/>
|
||||
<field name="expiry_date"/>
|
||||
<field name="is_expired" widget="boolean_toggle" readonly="1"/>
|
||||
<field name="attachment" widget="binary" filename="name" string="Upload"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_employee_filter_zoo_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.employee.search.zoo.inherit</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="inherit_id" ref="hr.view_employee_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//filter[@name='message_needaction']" position="before">
|
||||
<filter string="Zoo Keepers" name="is_zoo_keeper" domain="[('is_zoo_keeper', '=', True)]"/>
|
||||
<separator/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Định nghĩa Action: Zoo Keepers -->
|
||||
<record id="action_zoo_keepers" model="ir.actions.act_window">
|
||||
<field name="name">Keepers</field>
|
||||
<field name="res_model">hr.employee</field>
|
||||
<field name="view_mode">list,form,kanban</field>
|
||||
<field name="domain">[('is_zoo_keeper', '=', True)]</field>
|
||||
<field name="context">{'default_is_zoo_keeper': True}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Add a new Zoo Keeper
|
||||
</p>
|
||||
<p>
|
||||
Manage keeper profiles, specialities, and certifications.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Định nghĩa menu item Keepers -->
|
||||
<menuitem id="menu_zoo_keepers_management"
|
||||
name="Keepers Management"
|
||||
parent="menu_zoo"
|
||||
sequence="20"/>
|
||||
|
||||
|
||||
<!-- Định nghĩa menu item Keepers -->
|
||||
<menuitem id="menu_zoo_keepers_list"
|
||||
name="Keepers"
|
||||
parent="menu_zoo_keepers_management"
|
||||
action="action_zoo_keepers"
|
||||
sequence="10"/>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@ -8,10 +8,18 @@
|
||||
'version': '0.1',
|
||||
'depends': [
|
||||
'zoo', # <-- depends on zoo (parent - Folder name) addon
|
||||
'point_of_sale', # <-- depends on point_of_sale addon
|
||||
],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
|
||||
'assets': {
|
||||
'point_of_sale._assets_pos': [
|
||||
'zoo_plus/static/src/xml/product_card_name_template.xml',
|
||||
'zoo_plus/static/src/xml/product_price.xml',
|
||||
],
|
||||
},
|
||||
'demo': [],
|
||||
'css': [],
|
||||
# 'qweb': ['static/src/xml/*.xml'],
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="product_card_name_template" xml:space="preserve">
|
||||
<t t-inherit="point_of_sale.ProductCard" t-inherit-mode="extension">
|
||||
<xpath expr="//div[@t-esc='props.name']" position="attributes">
|
||||
<attribute name="style">font-family: "Cambria";
|
||||
font-weight: 600;
|
||||
font-size: 120%;
|
||||
color: #2563eb;</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
20
addons/zoo_plus/static/src/xml/product_price.xml
Normal file
20
addons/zoo_plus/static/src/xml/product_price.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="product_price" xml:space="preserve">
|
||||
<t t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
|
||||
<xpath expr="//span[@t-out='order.currencyDisplayPriceIncl']" position="attributes">
|
||||
<attribute name="style">font-family: "Aptos";
|
||||
font-weight: 600;
|
||||
font-size: 120%;
|
||||
color: #6711d6ff;</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t t-inherit="point_of_sale.OrderWidget" t-inherit-mode="extension">
|
||||
<xpath expr="//span[@class='total']" position="attributes">
|
||||
<attribute name="style">font-weight: bold;
|
||||
text-decoration: underline;
|
||||
color: #7618f1ff;</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
Loading…
Reference in New Issue
Block a user