diff --git a/diet_template/LICENSE/LICENSE b/diet_template/LICENSE/LICENSE new file mode 100644 index 0000000..84bb10a --- /dev/null +++ b/diet_template/LICENSE/LICENSE @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2019-TODAY Serpent Consulting Services Pvt. Ltd. (). + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/diet_template/README.rst b/diet_template/README.rst new file mode 100644 index 0000000..2a25c8e --- /dev/null +++ b/diet_template/README.rst @@ -0,0 +1,63 @@ +========================= +Diet Template Management +========================= + +The Diet Plan Template Management System module is manage Diet Plan Designing and Scheduling. + +========= +Features +========= + +* Diet Meals + + - Create customized diet meals based on the intervals along with the quantity to be taken. + +* Diet Routines + + - Select multiple diet meals and you can plan a diet routine for your gym members. + +* Food Items + + - Configure food items along with their nutritive value. + +* Diet Plan Assignment + + - Easily assign a diet plan to the member. + - You can set a start date and the end date and the number of days will be automatically calculated upon start date. + - The plans in the hierarchy will get populated and assigned automatically. + +* My Diet Plans + + - Member can see his diet plan and check what he has to eat on a particular day. + +============ +Similar Apps +============ + +Diet Template Management +Diet Template +Diet Plan Designing and Scheduling +Diet app template +Diet plan template +Diet record template +Diet schedule template +Diet design template +Diet plan sheet template +Diet plan table template +Diet analysis template +Diet diary template +Diet food journal template +Diet food log template +Diet meal plan template +Diet meal template +Diet plan schedule template +Diet planner template +Diet planning template +Diet website template +Meals diet plan template +Odoo Diet Template +Odoo DietTemplate Management +Diet Template Management System +odoo diet plan template +Diet Template Management System in odoo +Diet plan template tool diff --git a/diet_template/__init__.py b/diet_template/__init__.py new file mode 100644 index 0000000..850d885 --- /dev/null +++ b/diet_template/__init__.py @@ -0,0 +1,4 @@ +# See LICENSE file for full copyright and licensing details. + +from . import models +from . import wizard diff --git a/diet_template/__manifest__.py b/diet_template/__manifest__.py new file mode 100644 index 0000000..8a7f48f --- /dev/null +++ b/diet_template/__manifest__.py @@ -0,0 +1,31 @@ +# See LICENSE file for full copyright and licensing details. + +{ + 'name': 'Diet Template', + 'summary': 'Diet Plan Designing and Scheduling', + 'author': 'Serpent Consulting Services Pvt. Ltd.', + 'maintainer': 'Serpent Consulting Services Pvt. Ltd.', + 'license': 'LGPL-3', + 'category': 'Gym Management', + 'website': 'http://www.serpentcs.com', + 'version': '13.0.1.0.0', + 'sequence': 1, + 'depends': ['gym'], + 'data': [ + 'security/ir.model.access.csv', + 'views/diet_view.xml', + 'views/project_view.xml', + 'views/project_task_view.xml', + 'views/menuitem_hide.xml', + 'views/sale_order_view.xml', + 'wizard/diet_schedule_view.xml', + "views/partner_view.xml", + ], + 'demo': [ + 'demo/diet_plan_demo.xml', + ], + 'images': ['static/description/gym2.jpg'], + 'installable': True, + 'price': 99, + 'currency': 'EUR', +} diff --git a/diet_template/__pycache__/__init__.cpython-36.pyc b/diet_template/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..bcd688e Binary files /dev/null and b/diet_template/__pycache__/__init__.cpython-36.pyc differ diff --git a/diet_template/__pycache__/__init__.cpython-37.pyc b/diet_template/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..77820a4 Binary files /dev/null and b/diet_template/__pycache__/__init__.cpython-37.pyc differ diff --git a/diet_template/demo/diet_plan_demo.xml b/diet_template/demo/diet_plan_demo.xml new file mode 100644 index 0000000..6accef1 --- /dev/null +++ b/diet_template/demo/diet_plan_demo.xml @@ -0,0 +1,1163 @@ + + + + + Detox diet Plan + + + High Carbohydrate Diet + + + Healthy Fat Diet + + + 3000 Calories Plan + + + 1200 Calories Plan + + + High in Carbs + + + High in Protien + + + Low Fat + + + Low Calories + + + Low sodium + + + + + Diet Plan For Weight Gain + + + + Diet Plan For Weight Loss + + + + High Protien Diet + + + + + + early_morning + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + + + 2 + + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 20 + + + + + 1 + + + + + 1 + + + + + 2 + + + + + 1 + + + + + 1 + + + + + 20 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + early_morning + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + + + 2 + + + + + 2 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 20 + + + + + 5 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 20 + + + + + 1 + + + + + 5 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 5 + + + + + early_morning + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + + + 2 + + + + + 4 + + + + + 4 + + + + + 4 + + + + + 5 + + + + + 2 + + + + + 1 + + + + + 6 + + + + + 1 + + + + + 6 + + + + + 20 + + + + + 1 + + + + + 1 + + + + + 2 + + + + + 4 + + + + + 1 + + + + + early_morning + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + early_morning + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + breakfast + + + + pre_lunch + + + + lunch + + + + snack + + + + dinner + + + + + + + + 1 + + + + + 2 + + + + + 2 + + + + + 2 + + + + + 2 + + + + + 4 + + + + + 5 + + + + + 15 + + + + + 2 + + + + + 6 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 2 + + + + + 1 + + + + + 4 + + + + + 3 + + + + + 1 + + + + + 1 + + + + + 2 + + + + + + + 1 + + + + + 2 + + + + + 2 + + + + + 2 + + + + + 2 + + + + + 2 + + + + + 5 + + + + + 15 + + + + + 10 + + + + + 3 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 2 + + + + + 1 + + + + + 2 + + + + + 1 + + + + + 2 + + + + + + + 1 + + + + + 2 + + + + + 2 + + + + + 2 + + + + + 5 + + + + + 15 + + + + + 10 + + + + + 1 + + + + + 1 + + + + + 4 + + + + + 1 + + + + + 2 + + + + + 1 + + + + + 2 + + + + + + + 1 + + + + + 2 + + + + + 4 + + + + + 2 + + + + + 2 + + + + + 4 + + + + + 5 + + + + + 15 + + + + + 10 + + + + + 1 + + + + + 1 + + + + + 2 + + + + + 1 + + + + + 4 + + + + + 1 + + + + + 4 + + + + + + + 1 + + + + + 2 + + + + + 4 + + + + + 2 + + + + + 2 + + + + + 4 + + + + + 5 + + + + + 15 + + + + + 10 + + + + + 1 + + + + + 1 + + + + + 4 + + + + + 1 + + + + + 4 + + + + + 1 + + + + + 4 + + + + + + + 1 + + + + + 2 + + + + + 4 + + + + + 2 + + + + + 2 + + + + + 4 + + + + + 5 + + + + + 15 + + + + + 10 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 4 + + + + + 4 + + + + + 4 + + + + + + + 1 + + + + + 2 + + + + + 4 + + + + + 2 + + + + + 2 + + + + + 4 + + + + + 5 + + + + + 15 + + + + + 10 + + + + + 3 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 4 + + + + + 1 + + + + + 4 + + + + + 1 + + + + + 4 + + + diff --git a/diet_template/models/__init__.py b/diet_template/models/__init__.py new file mode 100644 index 0000000..e61672a --- /dev/null +++ b/diet_template/models/__init__.py @@ -0,0 +1,6 @@ +# See LICENSE file for full copyright and licensing details. + +from . import diet +from . import project +from . import sale_order +from . import res_partner diff --git a/diet_template/models/__pycache__/__init__.cpython-36.pyc b/diet_template/models/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..d26c9a2 Binary files /dev/null and b/diet_template/models/__pycache__/__init__.cpython-36.pyc differ diff --git a/diet_template/models/__pycache__/__init__.cpython-37.pyc b/diet_template/models/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..3b07438 Binary files /dev/null and b/diet_template/models/__pycache__/__init__.cpython-37.pyc differ diff --git a/diet_template/models/__pycache__/diet.cpython-36.pyc b/diet_template/models/__pycache__/diet.cpython-36.pyc new file mode 100644 index 0000000..97bdfa6 Binary files /dev/null and b/diet_template/models/__pycache__/diet.cpython-36.pyc differ diff --git a/diet_template/models/__pycache__/diet.cpython-37.pyc b/diet_template/models/__pycache__/diet.cpython-37.pyc new file mode 100644 index 0000000..1340cc9 Binary files /dev/null and b/diet_template/models/__pycache__/diet.cpython-37.pyc differ diff --git a/diet_template/models/__pycache__/project.cpython-36.pyc b/diet_template/models/__pycache__/project.cpython-36.pyc new file mode 100644 index 0000000..6059ede Binary files /dev/null and b/diet_template/models/__pycache__/project.cpython-36.pyc differ diff --git a/diet_template/models/__pycache__/project.cpython-37.pyc b/diet_template/models/__pycache__/project.cpython-37.pyc new file mode 100644 index 0000000..38edec9 Binary files /dev/null and b/diet_template/models/__pycache__/project.cpython-37.pyc differ diff --git a/diet_template/models/__pycache__/res_partner.cpython-36.pyc b/diet_template/models/__pycache__/res_partner.cpython-36.pyc new file mode 100644 index 0000000..76a6599 Binary files /dev/null and b/diet_template/models/__pycache__/res_partner.cpython-36.pyc differ diff --git a/diet_template/models/__pycache__/res_partner.cpython-37.pyc b/diet_template/models/__pycache__/res_partner.cpython-37.pyc new file mode 100644 index 0000000..94e7377 Binary files /dev/null and b/diet_template/models/__pycache__/res_partner.cpython-37.pyc differ diff --git a/diet_template/models/__pycache__/sale_order.cpython-36.pyc b/diet_template/models/__pycache__/sale_order.cpython-36.pyc new file mode 100644 index 0000000..637bba8 Binary files /dev/null and b/diet_template/models/__pycache__/sale_order.cpython-36.pyc differ diff --git a/diet_template/models/__pycache__/sale_order.cpython-37.pyc b/diet_template/models/__pycache__/sale_order.cpython-37.pyc new file mode 100644 index 0000000..c1a4f5e Binary files /dev/null and b/diet_template/models/__pycache__/sale_order.cpython-37.pyc differ diff --git a/diet_template/models/diet.py b/diet_template/models/diet.py new file mode 100644 index 0000000..b61e541 --- /dev/null +++ b/diet_template/models/diet.py @@ -0,0 +1,47 @@ +# See LICENSE file for full copyright and licensing details. + +from odoo import api, fields, models + + +class DietList(models.Model): + """New model for creating diet Task.""" + + _name = 'diet.list' + _description = 'Information of task,interval and food items in task.' + + name = fields.Char('Name') + sequence = fields.Integer("Sequence") + diet_id = fields.Many2one('diet.master', 'Diet Line') + food_item_ids = fields.One2many('diet.plan.lines', 'diet_list_id', 'Food') + + +class DietMaster(models.Model): + """Information about diet plan and task in the plan and total + days of task. + """ + + _name = 'diet.master' + _description = 'Diet Master' + + name = fields.Char("Goal") + diet_task_ids = fields.One2many('diet.list', 'diet_id', 'Diet') + total_days = fields.Integer( + compute="_compute_calculate_total_days", + string="Total Days Of Diet Plan") + diet_plan_ids = fields.Many2many('diet.list', 'master_list_rel', + 'master_id', 'diet_list_id', + string="Diet Task") + + @api.depends('diet_plan_ids') + def _compute_calculate_total_days(self): + """Calculating total days of PLan.""" + for diet_master_rec in self: + diet_master_rec.total_days = \ + len(diet_master_rec.diet_plan_ids.ids) + + +class DietPlanLines(models.Model): + _inherit = 'diet.plan.lines' + + diet_list_id = fields.Many2one('diet.list', 'project task list') + diet_plan_id = fields.Many2one('project.task', 'Diet plan in task') diff --git a/diet_template/models/project.py b/diet_template/models/project.py new file mode 100644 index 0000000..f3c4eda --- /dev/null +++ b/diet_template/models/project.py @@ -0,0 +1,23 @@ +# See LICENSE file for full copyright and licensing details. + +from odoo import fields, models + + +class Project(models.Model): + """Inherited Project model for creating diet project.""" + + _inherit = 'project.project' + + product_id = fields.Many2one('product.product', string='Client Product') + type = fields.Selection([('workout', 'Workout'), ('diet', 'Diet')], 'Type') + + +class Task(models.Model): + """Inherited Project Task model for creating diet project.""" + + _inherit = "project.task" + _order = 'schedule_date asc' + _description = 'Details of task in diet plan.' + + diet_plan_ids = fields.One2many( + 'diet.plan.lines', 'diet_plan_id', 'Diet Plan') diff --git a/diet_template/models/res_partner.py b/diet_template/models/res_partner.py new file mode 100644 index 0000000..6ae3362 --- /dev/null +++ b/diet_template/models/res_partner.py @@ -0,0 +1,18 @@ +# See LICENSE file for full copyright and licensing details. + +from odoo import api, fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + member_diet_plan = fields.Integer( + string='Diet Plan', + compute='_compute_member_diet_plan' + ) + + def _compute_member_diet_plan(self): + for rec in self: + rec.member_diet_plan = \ + self.env['project.project'].search_count( + [('partner_id', '=', rec.id)]) \ No newline at end of file diff --git a/diet_template/models/sale_order.py b/diet_template/models/sale_order.py new file mode 100644 index 0000000..63923f7 --- /dev/null +++ b/diet_template/models/sale_order.py @@ -0,0 +1,15 @@ +# See LICENSE file for full copyright and licensing details. + +from odoo import api, models + + +class SaleOrder(models.Model): + + _inherit = 'sale.order' + + @api.model + def create(self, values): + rec = super(SaleOrder, self).create(values) + if self._context.get("is_diet_sale"): + rec.action_confirm() + return rec diff --git a/diet_template/security/ir.model.access.csv b/diet_template/security/ir.model.access.csv new file mode 100644 index 0000000..85e6042 --- /dev/null +++ b/diet_template/security/ir.model.access.csv @@ -0,0 +1,12 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_diet_list,access.diet_list,model_diet_list,base.group_user,1,1,1,1 +access_diet_master,access.diet_master,model_diet_master,base.group_user,1,1,1,1 +access_diet_master_trainer,access.diet_master.trainer,model_diet_master,gym.group_gym_trainer,1,1,1,1 +access_diet_list_trainer,access.diet_list.trainer,model_diet_list,gym.group_gym_trainer,1,1,1,1 +access_diet_master_member,access.diet_master.member,model_diet_master,gym.group_gym_member,1,0,0,0 +access_diet_list_member,access.diet_list.member,model_diet_list,gym.group_gym_member,1,0,0,0 +access_diet_master_operator,access.diet_master.operator,model_diet_master,gym.group_gym_operator,1,1,1,1 +access_diet_list_operator,access.diet_list.operator,model_diet_list,gym.group_gym_operator,1,1,1,1 +access_diet_master_manager,access.diet_master.manager,model_diet_master,gym.group_gym_manager,1,1,1,1 +access_diet_list_manager,access.diet_list.manager,model_diet_list,gym.group_gym_manager,1,1,1,1 +access_project_project_trainer,access.project_project.trainer,project.model_project_project,gym.group_gym_trainer,1,1,1,1 diff --git a/diet_template/static/description/fb.jpg b/diet_template/static/description/fb.jpg new file mode 100644 index 0000000..8fa52d3 Binary files /dev/null and b/diet_template/static/description/fb.jpg differ diff --git a/diet_template/static/description/gym2.jpg b/diet_template/static/description/gym2.jpg new file mode 100644 index 0000000..bad774f Binary files /dev/null and b/diet_template/static/description/gym2.jpg differ diff --git a/diet_template/static/description/icon.png b/diet_template/static/description/icon.png new file mode 100644 index 0000000..5dfa0a2 Binary files /dev/null and b/diet_template/static/description/icon.png differ diff --git a/diet_template/static/description/icon2.png b/diet_template/static/description/icon2.png new file mode 100644 index 0000000..cf039e0 Binary files /dev/null and b/diet_template/static/description/icon2.png differ diff --git a/diet_template/static/description/img/dt2.png b/diet_template/static/description/img/dt2.png new file mode 100644 index 0000000..1a23f2d Binary files /dev/null and b/diet_template/static/description/img/dt2.png differ diff --git a/diet_template/static/description/img/food-k.png b/diet_template/static/description/img/food-k.png new file mode 100644 index 0000000..888c4af Binary files /dev/null and b/diet_template/static/description/img/food-k.png differ diff --git a/diet_template/static/description/img/food-n.png b/diet_template/static/description/img/food-n.png new file mode 100644 index 0000000..b3b3149 Binary files /dev/null and b/diet_template/static/description/img/food-n.png differ diff --git a/diet_template/static/description/img/in-1.png b/diet_template/static/description/img/in-1.png new file mode 100644 index 0000000..5b9feac Binary files /dev/null and b/diet_template/static/description/img/in-1.png differ diff --git a/diet_template/static/description/img/inter.png b/diet_template/static/description/img/inter.png new file mode 100644 index 0000000..6b8604f Binary files /dev/null and b/diet_template/static/description/img/inter.png differ diff --git a/diet_template/static/description/img/meals.png b/diet_template/static/description/img/meals.png new file mode 100644 index 0000000..8e62ff1 Binary files /dev/null and b/diet_template/static/description/img/meals.png differ diff --git a/diet_template/static/description/img/plan-new.png b/diet_template/static/description/img/plan-new.png new file mode 100644 index 0000000..b00f4da Binary files /dev/null and b/diet_template/static/description/img/plan-new.png differ diff --git a/diet_template/static/description/img/s1.png b/diet_template/static/description/img/s1.png new file mode 100644 index 0000000..7df809d Binary files /dev/null and b/diet_template/static/description/img/s1.png differ diff --git a/diet_template/static/description/img/tk-2.png b/diet_template/static/description/img/tk-2.png new file mode 100644 index 0000000..da5b346 Binary files /dev/null and b/diet_template/static/description/img/tk-2.png differ diff --git a/diet_template/static/description/img/wi.png b/diet_template/static/description/img/wi.png new file mode 100644 index 0000000..8c7bfae Binary files /dev/null and b/diet_template/static/description/img/wi.png differ diff --git a/diet_template/static/description/in.jpg b/diet_template/static/description/in.jpg new file mode 100644 index 0000000..d9b9a80 Binary files /dev/null and b/diet_template/static/description/in.jpg differ diff --git a/diet_template/static/description/index.html b/diet_template/static/description/index.html new file mode 100644 index 0000000..fb16d17 --- /dev/null +++ b/diet_template/static/description/index.html @@ -0,0 +1,361 @@ + + + +
+
+
+ +
+
+
+
+

+ Diet Template +

+
+
+ + + +
+ +
+

+ Diet Meals +

+
+
+
    +
  • +

    Create customized diet meals based on the intervals along with the quantity to be taken. +

    +
  • +
+
+
+ +
+
+ +
+
+

+ Diet Routines +

+
+
+
    +
  • +

    Select multiple diet meals and you can plan a diet routine for your gym members.

    +
  • +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+

+ Food Items +

+
+
+
    +
  • +

    Configure food items along with thier nutritive value.

    +
  • +
+
+
+ +
+
+ +
+
+

+ Diet Plan Assignment +

+
+
+
    +
  • +

    Easily assign an diet plan to the member. +

    +
  • +
  • +

    You can set a start date and the end date + and the number of days will be automatically calculated upon start date. +

    +
  • +
  • +

    The plans in the hierarchy will get populated and assigned automatically. +

    +
  • +
+
+
+ +
+
+

+ My Diet Plans +

+
+
+
    +
  • +

    Member can see his diet plan and check what he has to eat on a particular day. +

    +
  • +
+
+
+ +
+
+
+ + +
+
+

Check out our + various Odoo Services below

+
+
+ +
+
+

Check out our various + Odoo Based Products

+
+
+ +
+
+

For any questions, + support and development contact us.

+
+
+ +
+
+

(+91) 98793-54457, (+91) 90334-72982 + +91-79-2975-0867 +

+ WhatsApp, Telegram or Call 24X7 +
+
+
+
+
+ + + + + + + + + + + +
+
+
+ + diff --git a/diet_template/static/description/insta.jpg b/diet_template/static/description/insta.jpg new file mode 100644 index 0000000..c89a251 Binary files /dev/null and b/diet_template/static/description/insta.jpg differ diff --git a/diet_template/static/description/odooqa32.png b/diet_template/static/description/odooqa32.png new file mode 100644 index 0000000..b0db6c2 Binary files /dev/null and b/diet_template/static/description/odooqa32.png differ diff --git a/diet_template/static/description/serpent32.png b/diet_template/static/description/serpent32.png new file mode 100644 index 0000000..14612ca Binary files /dev/null and b/diet_template/static/description/serpent32.png differ diff --git a/diet_template/static/description/serpent_logo.png b/diet_template/static/description/serpent_logo.png new file mode 100644 index 0000000..68dacf8 Binary files /dev/null and b/diet_template/static/description/serpent_logo.png differ diff --git a/diet_template/static/description/twitter.jpg b/diet_template/static/description/twitter.jpg new file mode 100644 index 0000000..6d938f6 Binary files /dev/null and b/diet_template/static/description/twitter.jpg differ diff --git a/diet_template/static/description/youtube.jpg b/diet_template/static/description/youtube.jpg new file mode 100644 index 0000000..05382a7 Binary files /dev/null and b/diet_template/static/description/youtube.jpg differ diff --git a/diet_template/static/src/css/style.css b/diet_template/static/src/css/style.css new file mode 100644 index 0000000..4387298 --- /dev/null +++ b/diet_template/static/src/css/style.css @@ -0,0 +1,27 @@ +.scs_contactus_form{ + border-radius: 0px !important; + background-color: transparent; + color: #ffffff; + border: 2px solid #ffffff; +} + +.scs_contactus_form:-webkit-input-placeholder { + color: #ffffff; +} + +.scs_contactus_form:-moz-placeholder { /* Firefox 18- */ + color: #ffffff; +} + +.scs_contactus_form::-moz-placeholder { /* Firefox 19+ */ + color: #ffffff; +} + +.scs_contactus_form:-ms-input-placeholder { + color: #ffffff; +} + +.scs_contactus_setting{ + margin-left: 0px !important; + margin-right: 0px !important; +} \ No newline at end of file diff --git a/diet_template/static/src/img/crm_lead_img.png b/diet_template/static/src/img/crm_lead_img.png new file mode 100644 index 0000000..50ad147 Binary files /dev/null and b/diet_template/static/src/img/crm_lead_img.png differ diff --git a/diet_template/static/src/xml/widget.xml b/diet_template/static/src/xml/widget.xml new file mode 100644 index 0000000..1226d89 --- /dev/null +++ b/diet_template/static/src/xml/widget.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/diet_template/views/diet_view.xml b/diet_template/views/diet_view.xml new file mode 100644 index 0000000..eaec0b0 --- /dev/null +++ b/diet_template/views/diet_view.xml @@ -0,0 +1,284 @@ + + + + + view.diet.plan.lines.form + diet.plan.lines + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + + view.diet.plan.lines.tree + diet.plan.lines + + + + + + + + + + + Diet Plan + ir.actions.act_window + diet.plan.lines + form + tree,form + + + + + view.diet.plan.form + diet.plan + +
+ + +

+ +

+ + +
+
+
+
+
+ + + + view.diet.plan.tree + diet.plan + + + + + + + + + + + Diet Plans + ir.actions.act_window + diet.plan + form + tree,form + + + + + view.item.form + food.item + +
+ + + + + + + + +
+
+
+ + + + view.item.tree + food.item + + + + + + + + + + + Food Items + ir.actions.act_window + food.item + form + tree,form + [('is_food','=',True)] + {"food_default":True} + + + + + view.food.item.product.form + product.template + +
+ + +
+
+ + + + + + +
+ +

+ +

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+
+
+
+ + + + product.template.food.product.tree + product.template + 60 + + + + + + + + + + + + + + + + + Food Items + ir.actions.act_window + product.template + form + [('is_food','=',True)] + {'default_is_food':True} + kanban,tree,form + +

+ Click to add a new Food Item. +

+
+
+ + + + kanban + 0 + + + + + + + tree + 1 + + + + + + + form + 2 + + + + + + + + + +
diff --git a/diet_template/views/menuitem_hide.xml b/diet_template/views/menuitem_hide.xml new file mode 100644 index 0000000..c91ec91 --- /dev/null +++ b/diet_template/views/menuitem_hide.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/diet_template/views/partner_view.xml b/diet_template/views/partner_view.xml new file mode 100644 index 0000000..d909a6a --- /dev/null +++ b/diet_template/views/partner_view.xml @@ -0,0 +1,57 @@ + + + + + + + Diet Plan + ir.actions.act_window + project.project + form + kanban,tree,form + [('partner_id', '=', active_id)] + + + + view.diet.form.inherit + res.partner + + + + + + + + + diff --git a/diet_template/views/project_task_view.xml b/diet_template/views/project_task_view.xml new file mode 100644 index 0000000..7efd147 --- /dev/null +++ b/diet_template/views/project_task_view.xml @@ -0,0 +1,18 @@ + + + + view.project.task.inherited + project.task + + + + + + + + + + + diff --git a/diet_template/views/project_view.xml b/diet_template/views/project_view.xml new file mode 100644 index 0000000..97a6926 --- /dev/null +++ b/diet_template/views/project_view.xml @@ -0,0 +1,350 @@ + + + + + + view.project.search.inherited + project.project + + + + + + + + + + view.project.kanban.inherited + project.project + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+
+ + + view.project.tree.inherited + project.project + + + + false + false + + + Trainer + + + Member + + + Plan Name + + + + + + + + + view.project.form.inherited + project.project + + +
+ false + false +
+ + 1 + + + 1 + + + Trainer + + + Member + +
+
+ + + + All Diet Plans + ir.actions.act_window + project.project + form + kanban,tree,form + [('type','=','diet'),] + {'default_type':'diet'} + + + + + + diet.list.form + diet.list + +
+ + + + + + + + + +
+
+
+ + + diet.list.tree + diet.list + + + + + + + + + + + diet.list.kanban + diet.list + + + + + + +
+
+
+
+
+ Contact +
+
+ +
+
+

+ +

+
+
+
+
+
+
+
+
+ + + Diet Meals + ir.actions.act_window + diet.list + form + kanban,tree,form + {} + [] + + + + + + + diet.list.form + diet.list + +
+ + + + + + + + + +
+
+
+ + + diet.list.tree + diet.list + + + + + + + + Diet Meals + ir.actions.act_window + diet.list + form + kanban,tree,form + {} + [] + +

+ Click here to add new diet meal. +

+ +
+
+ + + + diet.form + diet.master + +
+ + +

+ +

+
+ + + + + + + +
+
+
+
+ + + diet.tree + diet.master + + + + + + + + + + + diet.master + diet.master + + + + + + +
+
+
+
+
+ Contact +
+
+ +
+
+

+ +

+
+
+
+
+ + + + Days +
+
+
+
+
+
+
+
+ + + Diet Plans + ir.actions.act_window + diet.master + form + kanban,tree,form + {} + [] + +

+ Click here to add new diet routine. +

+
+
+ + + + +
diff --git a/diet_template/views/sale_order_view.xml b/diet_template/views/sale_order_view.xml new file mode 100644 index 0000000..7ebcbb8 --- /dev/null +++ b/diet_template/views/sale_order_view.xml @@ -0,0 +1,36 @@ + + + + sale.order.form.inherit.diet + sale.order + + + + + [('is_member','=?',context.get('is_diet_sale'))] + + + + + [('is_food','=?',context.get('is_diet_sale')), + ('type','!=','service')] + + + + + + + Sales + ir.actions.act_window + sale.order + form + tree,form + + {'is_diet_sale': True} + + + + + diff --git a/diet_template/wizard/__init__.py b/diet_template/wizard/__init__.py new file mode 100644 index 0000000..18c5c20 --- /dev/null +++ b/diet_template/wizard/__init__.py @@ -0,0 +1,3 @@ +# See LICENSE file for full copyright and licensing details. + +from . import diet_schedule diff --git a/diet_template/wizard/__pycache__/__init__.cpython-36.pyc b/diet_template/wizard/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..d2ff4f7 Binary files /dev/null and b/diet_template/wizard/__pycache__/__init__.cpython-36.pyc differ diff --git a/diet_template/wizard/__pycache__/__init__.cpython-37.pyc b/diet_template/wizard/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..a09d941 Binary files /dev/null and b/diet_template/wizard/__pycache__/__init__.cpython-37.pyc differ diff --git a/diet_template/wizard/__pycache__/diet_schedule.cpython-36.pyc b/diet_template/wizard/__pycache__/diet_schedule.cpython-36.pyc new file mode 100644 index 0000000..70f0c93 Binary files /dev/null and b/diet_template/wizard/__pycache__/diet_schedule.cpython-36.pyc differ diff --git a/diet_template/wizard/__pycache__/diet_schedule.cpython-37.pyc b/diet_template/wizard/__pycache__/diet_schedule.cpython-37.pyc new file mode 100644 index 0000000..bb4f798 Binary files /dev/null and b/diet_template/wizard/__pycache__/diet_schedule.cpython-37.pyc differ diff --git a/diet_template/wizard/diet_schedule.py b/diet_template/wizard/diet_schedule.py new file mode 100644 index 0000000..3c9147f --- /dev/null +++ b/diet_template/wizard/diet_schedule.py @@ -0,0 +1,111 @@ +# See LICENSE file for full copyright and licensing details. + +from datetime import datetime, timedelta +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError +from odoo.tools import DEFAULT_SERVER_DATE_FORMAT + + +class DietSchedule(models.TransientModel): + """object for taking information about Diet schedule.""" + + _name = 'diet.scheduling' + _description = 'Diet Schedule' + + member_id = fields.Many2one('res.partner', string='Member') + goal_id = fields.Many2one('diet.master', string='Diet Plan') + total_days = fields.Integer(string="Total Days Of Plan", + compute='_compute_total_days') + start_date = fields.Date(string='Start Date', + default=datetime.strftime( + datetime.now(), DEFAULT_SERVER_DATE_FORMAT)) + end_date = fields.Date(string='End Date') + + @api.onchange('member_id') + def _onchange_member_id(self): + if self.env.user.has_group('gym.group_gym_trainer'): + partner_list = [] + calendar_event_ids = self.env['calendar.event'].search( + [('trainer_id.user_id', '=', self.env.user.id)]) + for rec in calendar_event_ids: + partner_list += rec.partner_ids.ids + return {'domain': { + 'member_id': [('id', 'in', partner_list)]}} + return {} + + @api.onchange('goal_id', 'start_date') + def _onchange_total_diet_plan_days(self): + """Method for assign total days based on goal.""" + # End Date assign + if not self.total_days: + self.end_date = datetime.strftime( + datetime.now(), DEFAULT_SERVER_DATE_FORMAT) + elif self.start_date: + self.end_date = \ + self.start_date + timedelta(days=self.total_days - 1) + + @api.depends('goal_id', 'start_date') + def _compute_total_days(self): + # Set the total Days + self.total_days = self.goal_id.total_days + + def schedule_project(self): + """Method for assign workout project to member.""" + project = self.env['project.project'] + project_task = self.env['project.task'] + user_obj = self.env['res.users'] + project_kanban = self.env.ref('project.view_project_kanban', False) + for diet_schedule_rec in self: + user_rec = user_obj.search( + [('partner_id', '=', diet_schedule_rec.member_id.id)]) + if not user_rec: + raise ValidationError(_('Please make the customer as user')) + elif not diet_schedule_rec.total_days: + raise ValidationError(_('You can\'t created diet schedule ' + 'with total days of zero.')) + else: + # Creating the project + val = { + 'name': diet_schedule_rec.member_id.name + "'s " + + diet_schedule_rec.goal_id.name + ' Schedule', + 'type': 'diet', + 'partner_id': diet_schedule_rec.member_id.id + } + project_id = project.create(val) + start_tm = diet_schedule_rec.start_date + for task_rec in diet_schedule_rec.goal_id.diet_plan_ids: + interval_list = [] + # loop on diet paln lines + for diet_line in task_rec.food_item_ids: + food_list = [] + # loop omn food items + for food_rec in diet_line.food_item_ids: + food_list.append((0, 0, { + 'food_name_id': food_rec.food_name_id.id, + 'quantity': food_rec.quantity + })) + interval_list.append((0, 0, { + 'interval': diet_line.interval, + 'food_item_ids': food_list + })) + # creating task and assign it to project + project_task.create({'name': task_rec.name + " Plan ", + 'project_id': project_id.id, + 'diet_plan_ids': interval_list, + 'schedule_date': start_tm, + 'user_id': user_rec.id, + 'sequence': task_rec.sequence, + 'task_type': 'diet' + }) + start_tm = start_tm + timedelta(days=1) + return { + 'type': 'ir.actions.act_window', + 'domain': [('id', '=', project_id.id)], + 'binding_view_types': 'form', + 'view_mode': 'kanban,tree,form', + 'res_model': 'project.project', + 'view_id': project_kanban.id, + 'views': [(project_kanban.id, 'kanban'), (False, 'form')], + 'context': dict(create=False), + 'target': 'new' + } diff --git a/diet_template/wizard/diet_schedule_view.xml b/diet_template/wizard/diet_schedule_view.xml new file mode 100644 index 0000000..aab0c00 --- /dev/null +++ b/diet_template/wizard/diet_schedule_view.xml @@ -0,0 +1,46 @@ + + + + + view.diet.schedule.form + diet.scheduling + +
+ + + + + + + +
+
+
+
+
+ + + + Assign Diet Plan + diet.scheduling + form + form + new + + + + + + +