forked from OCA/vertical-ngo
-
Notifications
You must be signed in to change notification settings - Fork 3
[WIP] Service Planner: modulo pianificazione turni #1
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
Closed
Closed
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
5b0ac64
[INI] initial commit
mymage b1229f5
[DEV] add srv.allocated calendar view
mymage 6026fe9
[DEV] add equipment reference on calendar
mymage 5f3259b
[FIX] travis
mymage 535f01d
[FIX] multiple services _cmp_stop_sked
mymage 3d67a4c
[DEV] calendar: add employees name; srv_tmplt: add color
mymage 8793208
[DEV] add timeline view (to fix)
mymage 5b9e301
[FIX] manage empty duration
mymage ad901d7
[DEV] add global ref to allocate service, change timeline group, fix …
mymage 0b895b1
[DEV] add services generation
mymage 29bf78a
[REF] menu
mymage e918f57
[REF] heavy refactoring
mymage bff22f3
[DEV] add off_duty shift, partner reference on employee
mymage c89ed3b
[DEV] add next service on template
mymage dcf1bb9
[DEV] initial rules and rule class definitions
mymage e766ace
[DEV] add initial rules and profile definitions
mymage a2491f3
[IMP] Add new field profile on employee
marcelofrare f2934cb
Merge pull request #2 from marcelofrare/12_service_planner_mf_improve_01
mymage b0d97b3
[DEV] add rule check button on allocate service
mymage cf4b9e1
[FIX] var names
mymage 661b055
[DEV] add check all button (to fix), check on save
mymage 5eaaba1
[DEV] add expected check, fix next, generation
mymage 304ea04
[DEV] add expected check, fix readme, fix todo
mymage 5d786ff
[FIX] service generation; demo data to fix
mymage 9ca1dcb
[FIX] demo data
mymage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| =========================== | ||
| Vertical NGO - Service Plan | ||
| =========================== | ||
|
|
||
| .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Beta | ||
| .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fvertical--ngo-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/vertical-ngo/tree/12.0/service_planner | ||
| :alt: OCA/vertical-ngo | ||
| .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
| :target: https://translation.odoo-community.org/projects/vertical-ngo-12-0/vertical-ngo-12-0-service_planner | ||
| :alt: Translate me on Weblate | ||
| .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
| :target: https://runbot.odoo-community.org/runbot/160/12.0 | ||
| :alt: Try me on Runbot | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| These module manages the Service Planner. | ||
|
|
||
| _TODO_ | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Installation | ||
| ============ | ||
|
|
||
| Istall with standar method | ||
|
|
||
| Configuration | ||
| ============= | ||
|
|
||
| This module doesn't need configuration | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| Steps to follow to use Service Planner: | ||
|
|
||
| _TODO_ | ||
|
|
||
| **Global Service** | ||
| * _TODO_ | ||
|
|
||
| **Service Template** | ||
| * _TODO_ | ||
|
|
||
| **Section → SubSection** | ||
| * _TODO_ | ||
|
|
||
| Changelog | ||
| ========= | ||
|
|
||
| 12.0.1.0.0 (2020-05-01) | ||
| ~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| * [INI] Initial development | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/vertical-ngo/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
| `feedback <https://github.com/OCA/vertical-ngo/issues/new?body=module:%20service_planner%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ~~~~~~~ | ||
|
|
||
| * Associazione PNLUG - Gruppo Odoo | ||
|
|
||
| Contributors | ||
| ~~~~~~~~~~~~ | ||
|
|
||
| * Stefano Consolaro <stefano.consolaro@mymage.it> | ||
|
|
||
| Maintainers | ||
| ~~~~~~~~~~~ | ||
|
|
||
| This module is maintained by the OCA. | ||
|
|
||
| .. image:: https://odoo-community.org/logo.png | ||
| :alt: Odoo Community Association | ||
| :target: https://odoo-community.org | ||
|
|
||
| OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
| mission is to support the collaborative development of Odoo features and | ||
| promote its widespread use. | ||
|
|
||
| This module is part of the `OCA/vertical-ngo <https://github.com/OCA/vertical-ngo/tree/12.0/service_planner>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ToDo list | ||
|
|
||
|
|
||
| **Model** | ||
|
|
||
|
|
||
| **View** | ||
| * service allocate calendar | ||
| * fix employee name display (newline separated) | ||
| * lock action on empty cells |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
|
|
||
| from . import ( | ||
| models, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| { | ||
| "name": "Vertical NGO - Service Plan", | ||
| "summary": "Management of service planning.", | ||
| "version": "12.0.1.0.0", | ||
|
|
||
| "author": "Associazione PNLUG - Gruppo Odoo, Odoo Community Association (OCA)", | ||
| "website": "https://gitlab.com/PNLUG/", | ||
| "license": "AGPL-3", | ||
|
|
||
| "category": "Logistics", | ||
|
|
||
| "depends": [ | ||
| 'fleet', | ||
| 'maintenance', | ||
| 'hr', | ||
| 'product', | ||
| ], | ||
| "data": [ | ||
| 'security/ir.model.access.csv', | ||
| 'views/service_menu.xml', | ||
| 'views/service_view.xml', | ||
| ], | ||
| 'installable': True, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
|
|
||
| from . import expected_equipment, expected_vehicle, expected_job, \ | ||
| service_global, service_state, service_template, service_allocate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Copyright 2020 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class ExpectedEquipment(models.Model): | ||
| """ | ||
| Equipments list expected on a service | ||
| """ | ||
|
|
||
| # model | ||
| _name = 'expected.equipment' | ||
| _description = 'Service expected equipment' | ||
|
|
||
| # fields | ||
| # minimum quantity | ||
| min_qty = fields.Integer('Minimum quantity', required=True, default=1) | ||
| # maximum quantity: 0 for no limit | ||
| max_qty = fields.Integer('Maximum quantity', help="Value 0 means no limit") | ||
| # equipment required | ||
| equipment_id = fields.Many2one('maintenance.equipment', string='Equipment') | ||
|
|
||
| # define record name to display in form view | ||
| _rec_name = 'equipment_id' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Copyright 2020 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class ExpectedJob(models.Model): | ||
| """ | ||
| Job element expected on a service | ||
| """ | ||
|
|
||
| # model | ||
| _name = 'expected.job' | ||
| _description = 'Service expected job' | ||
|
|
||
| # fields | ||
| # minimum quantity | ||
| min_qty = fields.Integer('Minimum quantity', required=True, default=1) | ||
| # maximum quantity: 0 for no limit | ||
| max_qty = fields.Integer('Maximum quantity', help="Value 0 means no limit") | ||
| # role required | ||
| job_id = fields.Many2one('hr.job', string='Job') | ||
|
|
||
| # define record name to display in form view | ||
| _rec_name = 'job_id' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Copyright 2020 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class ExpectedVehicle(models.Model): | ||
| """ | ||
| Vehicle element expected on a service | ||
| """ | ||
|
|
||
| # model | ||
| _name = 'expected.vehicle' | ||
| _description = 'Service expected vehicle' | ||
|
|
||
| # fields | ||
| # minimum quantity | ||
| min_qty = fields.Integer('Minimum quantity', required=True, default=1) | ||
| # maximum quantity: 0 for no limit | ||
| max_qty = fields.Integer('Maximum quantity', help="Value 0 means no limit") | ||
| # vehicle | ||
| vehicle_id = fields.Many2one('fleet.vehicle', string='Vehicle') | ||
|
|
||
| # define record name to display in form view | ||
| _rec_name = 'vehicle_id' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Copyright 2020 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import fields, models, api | ||
| import datetime | ||
|
|
||
|
|
||
| class ServiceAllocate(models.Model): | ||
| """ | ||
| Allocated service with definition of all the template components | ||
| """ | ||
|
|
||
| # model | ||
| _name = 'service.allocate' | ||
| _description = 'Allocate service' | ||
|
|
||
| # fields | ||
| # template service reference | ||
| service_template_id = fields.Many2one('service.template', string='Teplate service') | ||
|
mymage marked this conversation as resolved.
Outdated
|
||
| service_color = fields.Char('service.template', related='service_template_id.x_color') | ||
|
|
||
| # assigned vehicles | ||
| vehicle_ids = fields.Many2many('fleet.vehicle', string='Vehicles') | ||
| # assigned employee | ||
| employee_ids = fields.Many2many('hr.employee', string='Équipe') | ||
| # employee names | ||
| employee_names = fields.Char('Employees', compute='_cmp_emply_name', store=True) | ||
| # assigned equipments | ||
| equipment_ids = fields.Many2many('maintenance.equipment', string='Equipments') | ||
|
|
||
| # locality reference | ||
| locality = fields.Char('Locality') | ||
|
|
||
| # skeduled start time | ||
| start_sked = fields.Datetime('Start skeduled') | ||
| # skeduled start time | ||
| stop_sked = fields.Datetime('Stop skeduled', compute='_cmp_stop_sked', store=True) | ||
| # effective start time | ||
| start_real = fields.Datetime('Start real') | ||
| # effective stop time | ||
| stop_real = fields.Datetime('Stop real') | ||
|
|
||
| # state of the service | ||
| state_id = fields.Many2one('service.state', string='State') | ||
|
|
||
| @api.depends('start_sked') | ||
| def _cmp_stop_sked(self): | ||
| for service in self: | ||
| service.stop_sked = service.start_sked + \ | ||
| datetime.timedelta(hours=service.service_template_id.duration) | ||
|
mymage marked this conversation as resolved.
Outdated
|
||
| return | ||
|
|
||
| @api.depends('employee_ids') | ||
| def _cmp_emply_name(self): | ||
| for service in self: | ||
| service.employee_names = '' | ||
| for employee in service.employee_ids: | ||
| service.employee_names = service.employee_names + ' ' + \ | ||
| employee.name | ||
| return | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Copyright 2020 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class ServiceGlobal(models.Model): | ||
| """ | ||
| General service definition that includes several time managed services | ||
| """ | ||
|
|
||
| # model | ||
| _name = 'service.global' | ||
| _description = 'General service definition' | ||
|
|
||
| # fields | ||
| # name | ||
| name = fields.Char('Name') | ||
| # description | ||
| description = fields.Char('Description') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Copyright 2020 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class ServiceState(models.Model): | ||
| """ | ||
| State of the allocated services | ||
| """ | ||
|
|
||
| # model | ||
| _name = 'service.state' | ||
| _description = 'States of allocated services' | ||
|
|
||
| # fields | ||
| # name | ||
| name = fields.Char('Name') | ||
| # description | ||
| description = fields.Char('Description') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Copyright 2020 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class ServiceTemplate(models.Model): | ||
| """ | ||
| Model of a service with definition of the required components | ||
| """ | ||
|
|
||
| # model | ||
| _name = 'service.template' | ||
| _description = 'Model of a service' | ||
|
|
||
| # fields | ||
| # name | ||
| name = fields.Char('Name', required=True) | ||
| # global service reference | ||
| service_global_ids = fields.Many2many('service.global', string='Global service') | ||
|
|
||
| # standard duration | ||
| duration = fields.Integer('Duration', required=True) | ||
| # duration uom | ||
| duration_uom_id = fields.Many2one('uom.uom', string='Unit of Measure') | ||
|
|
||
| # expected vehicles | ||
| exp_vehicle_ids = fields.Many2many('expected.vehicle', string='Vehicles') | ||
| # expected jobs | ||
| exp_job_ids = fields.Many2many('expected.job', string='Jobs') | ||
| # expected equipments | ||
| exp_equipment_ids = fields.Many2many('expected.equipment', string='Equipments') | ||
|
|
||
| # product reference used to valorize | ||
| product_id = fields.Many2one('product.product', string='Product reference') | ||
|
|
||
| x_color = fields.Char('Color') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| This module doesn't need configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Stefano Consolaro <stefano.consolaro@mymage.it> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| These module manages the Service Planner. | ||
|
|
||
| _TODO_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| 12.0.1.0.0 (2020-05-01) | ||
| ~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| * [INI] Initial development |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Install with standard method |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.