Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5b0ac64
[INI] initial commit
mymage May 5, 2020
b1229f5
[DEV] add srv.allocated calendar view
mymage May 6, 2020
6026fe9
[DEV] add equipment reference on calendar
mymage May 7, 2020
5f3259b
[FIX] travis
mymage May 7, 2020
535f01d
[FIX] multiple services _cmp_stop_sked
mymage May 7, 2020
3d67a4c
[DEV] calendar: add employees name; srv_tmplt: add color
mymage May 9, 2020
8793208
[DEV] add timeline view (to fix)
mymage May 10, 2020
5b9e301
[FIX] manage empty duration
mymage May 10, 2020
ad901d7
[DEV] add global ref to allocate service, change timeline group, fix …
mymage May 12, 2020
0b895b1
[DEV] add services generation
mymage May 14, 2020
29bf78a
[REF] menu
mymage May 15, 2020
e918f57
[REF] heavy refactoring
mymage May 16, 2020
bff22f3
[DEV] add off_duty shift, partner reference on employee
mymage May 18, 2020
c89ed3b
[DEV] add next service on template
mymage May 18, 2020
dcf1bb9
[DEV] initial rules and rule class definitions
mymage May 21, 2020
e766ace
[DEV] add initial rules and profile definitions
mymage May 22, 2020
a2491f3
[IMP] Add new field profile on employee
marcelofrare May 24, 2020
f2934cb
Merge pull request #2 from marcelofrare/12_service_planner_mf_improve_01
mymage May 24, 2020
b0d97b3
[DEV] add rule check button on allocate service
mymage May 24, 2020
cf4b9e1
[FIX] var names
mymage May 24, 2020
661b055
[DEV] add check all button (to fix), check on save
mymage May 24, 2020
5eaaba1
[DEV] add expected check, fix next, generation
mymage May 28, 2020
304ea04
[DEV] add expected check, fix readme, fix todo
mymage May 29, 2020
5d786ff
[FIX] service generation; demo data to fix
mymage May 29, 2020
9ca1dcb
[FIX] demo data
mymage May 30, 2020
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
109 changes: 109 additions & 0 deletions service_planner/README.rst
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
Comment thread
mymage marked this conversation as resolved.
Outdated

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.
10 changes: 10 additions & 0 deletions service_planner/TODO.rst
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
4 changes: 4 additions & 0 deletions service_planner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

from . import (
models,
)
27 changes: 27 additions & 0 deletions service_planner/__manifest__.py
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,
}
3 changes: 3 additions & 0 deletions service_planner/models/__init__.py
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
25 changes: 25 additions & 0 deletions service_planner/models/expected_equipment.py
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'
25 changes: 25 additions & 0 deletions service_planner/models/expected_job.py
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'
25 changes: 25 additions & 0 deletions service_planner/models/expected_vehicle.py
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'
60 changes: 60 additions & 0 deletions service_planner/models/service_allocate.py
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')
Comment thread
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)
Comment thread
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
20 changes: 20 additions & 0 deletions service_planner/models/service_global.py
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')
20 changes: 20 additions & 0 deletions service_planner/models/service_state.py
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')
37 changes: 37 additions & 0 deletions service_planner/models/service_template.py
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')
1 change: 1 addition & 0 deletions service_planner/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module doesn't need configuration
1 change: 1 addition & 0 deletions service_planner/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Stefano Consolaro <stefano.consolaro@mymage.it>
3 changes: 3 additions & 0 deletions service_planner/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
These module manages the Service Planner.

_TODO_
4 changes: 4 additions & 0 deletions service_planner/readme/HISTORY.rst
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
1 change: 1 addition & 0 deletions service_planner/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Install with standard method
Loading