Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master industry fitness center dhrs #239

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions fitness/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
'name': 'Fitness Center',
'version': '1.0',
'category': 'Health and Fitness',
'description': "",
'depends': [
'calendar',
'contacts',
'hr',
'knowledge',
'maintenance',
'planning',
'pos_sale',
'purchase',
'sale_project',
'sale_subscription',
'website_appointment',
'website_sale',
'web_studio',
],
'data': [
'data/res_config_settings.xml',
'data/ir_attachment_pre.xml',
'data/product_category.xml',
'data/pos_category.xml',
'data/product_pricelist.xml',
'data/sale_subscription.xml',
'data/project_task_type.xml',
'data/project_project.xml',
'data/project_task.xml',
'data/product_product.xml',
'data/pos_payment_method.xml',
'data/pos_config.xml',
'data/knowledge_cover.xml',
'data/knowledge_article.xml',
'data/knowledge_article_favorite.xml',
'data/mail_message.xml',
'data/appointment_resource.xml',
'data/appointment_type.xml',
'data/maintenance_equipment.xml',
'data/appointment_view.xml',
'data/planning_role.xml',
'data/ir_actions_server.xml',
'data/base_automation.xml',
'data/ir_model_data.xml',
],
'demo': [
'demo/website.xml',
'demo/res_partner.xml',
'demo/hr_employee.xml',
'demo/appointment_type.xml',
'demo/calendar_event.xml',
'demo/maintenance_request.xml',
'demo/product_product.xml',
'demo/product_supplierinfo.xml',
'demo/purchase_order.xml',
'demo/purchase_order_line.xml',
'demo/purchase_order_post.xml',
'demo/sale_order.xml',
'demo/sale_order_line.xml',
'demo/sale_order_post.xml',
'demo/planning_recurrency.xml',
'demo/planning_slot.xml',
'demo/website_ir_attachment.xml',
'demo/website_view.xml',
'demo/website_theme_apply.xml',
'demo/website_page.xml',
'demo/website_menu.xml',
'demo/product_pricelist.xml',
'demo/payment_provider_demo_post.xml',
],
'license': 'OPL-1',
'author': 'Odoo S.A.',
'images': ['images/main.png'],
}
11 changes: 11 additions & 0 deletions fitness/data/appointment_resource.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="appointment_resource_1" model="appointment.resource">
<field name="name">Yoga Room</field>
<field name="capacity">10</field>
</record>
<record id="appointment_resource_2" model="appointment.resource">
<field name="name">Hit Room</field>
<field name="capacity">15</field>
</record>
</odoo>
31 changes: 31 additions & 0 deletions fitness/data/appointment_type.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="appointment_type_1" model="appointment.type">
<field name="name">Hit Course</field>
<field name="location_id" ref="base.main_partner"/>
<field name="appointment_tz" model="res.users" eval="obj().env.ref('base.user_admin').tz or 'Europe/Brussels'"/>
<field name="category">recurring</field>
<field name="resource_ids" eval="[(6, 0, [ref('appointment_resource_2')])]"/>
<field name="can_publish" eval="True"/>
<field name="schedule_based_on">resources</field>
<field name="has_payment_step" eval="True"/>
<field name="product_id" ref="default_booking_product"/>
<field name="resource_manage_capacity" eval="True"/>
<field name="assign_method">resource_time</field>
<field name="slot_ids" eval="[(0, 0, {'weekday': '3', 'start_hour': 8.0, 'end_hour': 9.0})]"/>
</record>
<record id="appointment_type_2" model="appointment.type">
<field name="name">Yoga Course</field>
<field name="location_id" ref="base.main_partner"/>
<field name="appointment_tz" model="res.users" eval="obj().env.ref('base.user_admin').tz or 'Europe/Brussels'"/>
<field name="resource_ids" eval="[(6, 0, [ref('appointment_resource_1')])]"/>
<field name="category">recurring</field>
<field name="can_publish" eval="True"/>
<field name="schedule_based_on">resources</field>
<field name="has_payment_step" eval="True"/>
<field name="product_id" ref="product_product_6"/>
<field name="resource_manage_capacity" eval="True"/>
<field name="assign_method">resource_time</field>
<field name="slot_ids" eval="[(0, 0, {'weekday': '2', 'start_hour': 14.0, 'end_hour': 16.0})]"/>
</record>
</odoo>
11 changes: 11 additions & 0 deletions fitness/data/appointment_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<template id="custom_appointment_info_view" inherit_id="appointment.appointment_info">
<xpath expr="//div[@t-if=&quot;not based_on_users and appointment_type.resource_manage_capacity&quot;]" position="replace">
<div t-if="slots and max_capacity" class="mb-4">
vava-odoo marked this conversation as resolved.
Show resolved Hide resolved
<input type="hidden" name="resourceCapacity" value="1"/>
</div>
<div class="o_appointment_no_capacity d-flex mt-2 pb-0 text-center"/>
</xpath>
</template>
</odoo>
20 changes: 20 additions & 0 deletions fitness/data/base_automation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record id="cancelled_subscription_automation" model="base.automation">
<field name="name">Update Customer &gt; Pricelist</field>
<field name="action_server_ids" eval="[(6, 0, [ref('update_pricelist_server_action')])]"/>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="trigger">on_create_or_write</field>
<field name="trigger_field_ids" eval="[(6, 0, [ref('sale_subscription.field_sale_order__subscription_state')])]"/>
<field name="filter_pre_domain">[("subscription_state", "=", "3_progress")]</field>
</record>
<record id="free_courses_for_sub_automation" model="base.automation">
<field name="name">Update Customer &gt; Pricelist</field>
<field name="action_server_ids" eval="[(6, 0, [ref('update_customer_price_server_action')])]"/>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="trigger">on_create_or_write</field>
<field name="trigger_field_ids" eval="[(6, 0, [ref('sale_subscription.field_sale_order__subscription_state')])]"/>
<field name="filter_domain">[]</field>
<field name="filter_pre_domain">[("subscription_state", "!=", "3_progress"), ("subscription_state", "!=", False)]</field>
</record>
</odoo>
23 changes: 23 additions & 0 deletions fitness/data/ir_actions_server.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record id="update_customer_price_server_action" model="ir.actions.server">
<field name="name">Free courses for subs - Server Actions</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="state">object_write</field>
<field name="evaluation_type">value</field>
<field name="crud_model_id" ref="base.model_res_partner"/>
<field name="update_field_id" ref="product.field_res_partner__property_product_pricelist"/>
<field name="update_path">partner_id.property_product_pricelist</field>
<field name="resource_ref" ref="product_pricelist_2"/>
</record>
<record id="update_pricelist_server_action" model="ir.actions.server">
<field name="name">Update Pricelist for Partner</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="state">object_write</field>
<field name="evaluation_type">value</field>
<field name="crud_model_id" ref="base.model_res_partner"/>
<field name="update_field_id" ref="product.field_res_partner__property_product_pricelist"/>
<field name="update_path">partner_id.property_product_pricelist</field>
<field name="resource_ref" eval="False"/>
</record>
</odoo>
8 changes: 8 additions & 0 deletions fitness/data/ir_attachment_pre.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="ir_attachment_1009" model="ir.attachment">
<field name="name">Fitness Industry.jpg</field>
<field name="datas" type="base64" file="fitness/static/src/binary/ir_attachment/FitnessIndustry.jpg"/>
<field name="url">/unsplash/kFCdfLbu6zA/Fitness Industry.jpg</field>
</record>
</odoo>
9 changes: 9 additions & 0 deletions fitness/data/ir_model_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record id="cloc_exclude_custom_appointment_info_view" model="ir.model.data">
<field name="name">cloc_exclude_custom_appointment_info_view</field>
<field name="model">ir.ui.view</field>
<field name="module">__cloc_exclude__</field>
<field name="res_id" eval="ref('custom_appointment_info_view')"/>
</record>
</odoo>
Loading