-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by ivantodorovich
- Loading branch information
Showing
22 changed files
with
1,087 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,95 @@ | ||
==================================== | ||
Kanban Features for Vehicle Services | ||
==================================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| 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 | ||
.. |badge2| image:: https://img.shields.io/badge/github-OCA%2Ffleet-lightgray.png?logo=github | ||
:target: https://github.com/OCA/fleet/tree/12.0/fleet_vehicle_service_kanban | ||
:alt: OCA/fleet | ||
.. |badge3| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/fleet-12-0/fleet-12-0-fleet_vehicle_service_kanban | ||
:alt: Translate me on Weblate | ||
.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/291/12.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| | ||
|
||
This module adds the following features to vehicle services (fleet.vehicle.log.service): | ||
|
||
- Kanban view. | ||
- Features of mail (chatter) and acitivities, includes a new activity view. | ||
- Configurable activity types. Menu under `Fleet / Configuration / Services Logs / Activity Types`. | ||
- New fields: Responsible, Priority, Tags, Active, Stage. | ||
- Configurable stages. Menu under `Fleet / Configuration / Services Logs / Vehicle Services Stages`. | ||
- Configurable tags. Menu under `Fleet / Configuration / Services Logs / Vehicle Services Tags`. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/fleet/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/fleet/issues/new?body=module:%20fleet_vehicle_service_kanban%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 | ||
~~~~~~~ | ||
|
||
* Druidoo | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Druidoo <https://www.druidoo.io>`_: | ||
|
||
* Iván Todorovich <[email protected]> | ||
* Manuel Marquez <[email protected]> | ||
|
||
* `PnLUG - Gruppo Odoo <https://odoo.pnlug.it>`_: | ||
|
||
* Stefano Consolaro <[email protected]> (backport 13.0→12.0) | ||
|
||
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. | ||
|
||
.. |maintainer-mamcode| image:: https://github.com/mamcode.png?size=40px | ||
:target: https://github.com/mamcode | ||
:alt: mamcode | ||
.. |maintainer-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px | ||
:target: https://github.com/ivantodorovich | ||
:alt: ivantodorovich | ||
|
||
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-mamcode| |maintainer-ivantodorovich| | ||
|
||
This module is part of the `OCA/fleet <https://github.com/OCA/fleet/tree/12.0/fleet_vehicle_service_kanban>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains 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 @@ | ||
# Copyright 2020-Present Druidoo - Manuel Marquez <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
This file contains 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,26 @@ | ||
# Copyright 2020-Present Druidoo - Manuel Marquez <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Kanban Features for Vehicle Services", | ||
"summary": "Add features of kanban to logs of vehicle services.", | ||
"category": "Human Resources/Fleet", | ||
"author": "Druidoo, Odoo Community Association (OCA)", | ||
"maintainers": ["mamcode", "ivantodorovich"], | ||
"development_status": "Stable", | ||
"website": "https://github.com/OCA/fleet", | ||
"license": "AGPL-3", | ||
"version": "12.0.1.0.0", | ||
"depends": ["fleet", "mail"], | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"data/fleet_vehicle_log_services_stage_data.xml", | ||
"data/mail_message_subtype_data.xml", | ||
"views/fleet_vehicle_log_services_views.xml", | ||
"views/fleet_vehicle_log_services_stage_views.xml", | ||
"views/fleet_vehicle_log_services_tag_views.xml", | ||
"views/fleet_service_type_views.xml", | ||
"views/mail_activity_type_views.xml", | ||
], | ||
"installable": True, | ||
} |
10 changes: 10 additions & 0 deletions
10
fleet_vehicle_service_kanban/data/fleet_vehicle_log_services_stage_data.xml
This file contains 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 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
<record | ||
id="fleet_vehicle_log_services_stage_draft" | ||
model="fleet.vehicle.log.services.stage" | ||
> | ||
<field name="name">Draft</field> | ||
<field name="sequence">1</field> | ||
</record> | ||
</odoo> |
33 changes: 33 additions & 0 deletions
33
fleet_vehicle_service_kanban/data/mail_message_subtype_data.xml
This file contains 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,33 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
<record | ||
id="mail_message_subtype_fleet_service_purchaser_updated" | ||
model="mail.message.subtype" | ||
> | ||
<field name="name">Changed Purchaser</field> | ||
<field name="sequence">0</field> | ||
<field name="res_model">fleet.vehicle.log.services</field> | ||
<field name="default" eval="True" /> | ||
<field name="description">Changed Purchaser</field> | ||
</record> | ||
<record | ||
id="mail_message_subtype_fleet_service_vendor_updated" | ||
model="mail.message.subtype" | ||
> | ||
<field name="name">Changed Vendor</field> | ||
<field name="sequence">1</field> | ||
<field name="res_model">fleet.vehicle.log.services</field> | ||
<field name="default" eval="True" /> | ||
<field name="description">Changed Vendor</field> | ||
</record> | ||
<record | ||
id="mail_message_subtype_fleet_service_user_updated" | ||
model="mail.message.subtype" | ||
> | ||
<field name="name">Changed Responsible</field> | ||
<field name="sequence">2</field> | ||
<field name="res_model">fleet.vehicle.log.services</field> | ||
<field name="default" eval="True" /> | ||
<field name="description">Changed Responsible</field> | ||
</record> | ||
</odoo> |
This file contains 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,6 @@ | ||
# Copyright 2020-Present Druidoo - Manuel Marquez <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import fleet_vehicle_log_services | ||
from . import fleet_vehicle_log_services_stage | ||
from . import fleet_vehicle_log_services_tag |
68 changes: 68 additions & 0 deletions
68
fleet_vehicle_service_kanban/models/fleet_vehicle_log_services.py
This file contains 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,68 @@ | ||
# Copyright 2020-Present Druidoo - Manuel Marquez <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class FleetVehicleLogServices(models.Model): | ||
_name = "fleet.vehicle.log.services" | ||
_inherit = ["fleet.vehicle.log.services", "mail.thread", "mail.activity.mixin"] | ||
_description = "Services for vehicles" | ||
|
||
def _default_stage(self): | ||
stage = self.env.ref( | ||
"fleet_vehicle_service_kanban.fleet_vehicle_log_services_stage_draft", | ||
raise_if_not_found=False, | ||
) | ||
return stage if stage and stage.id else False | ||
|
||
stage_id = fields.Many2one( | ||
"fleet.vehicle.log.services.stage", | ||
"Stage", | ||
default=lambda self: self._default_stage(), | ||
group_expand="_read_group_stage_ids", | ||
tracking=True, | ||
help="Current state of the vehicle", | ||
ondelete="set null", | ||
) | ||
|
||
vendor_id = fields.Many2one(tracking=True) | ||
purchaser_id = fields.Many2one(tracking=True) | ||
user_id = fields.Many2one( | ||
"res.users", "Responsible", tracking=True, default=lambda self: self.env.user | ||
) | ||
priority = fields.Selection( | ||
[("0", "Normal"), ("1", "Important")], default="0", index=True | ||
) | ||
tag_ids = fields.Many2many( | ||
"fleet.vehicle.log.services.tag", | ||
"fleet_vehicle_log_services_tag_rel", | ||
"service_id", | ||
"tag_id", | ||
string="Tags", | ||
help="Classify and analyze your services categories like: Repair, Maintenance", | ||
) | ||
active = fields.Boolean(default=True, tracking=True) | ||
|
||
@api.model | ||
def _read_group_stage_ids(self, stages, domain, order): | ||
return self.env["fleet.vehicle.log.services.stage"].search([], order=order) | ||
|
||
def _track_subtype(self, init_values): | ||
self.ensure_one() | ||
if "purchaser_id" in init_values: | ||
return self.env.ref( | ||
"fleet_vehicle_service_kanban." | ||
"mail_message_subtype_fleet_service_purchaser_updated" | ||
) | ||
if "vendor_id" in init_values: | ||
return self.env.ref( | ||
"fleet_vehicle_service_kanban." | ||
"mail_message_subtype_fleet_service_vendor_updated" | ||
) | ||
if "user_id" in init_values: | ||
return self.env.ref( | ||
"fleet_vehicle_service_kanban." | ||
"mail_message_subtype_fleet_service_user_updated" | ||
) | ||
return super(FleetVehicleLogServices, self)._track_subtype(init_values) |
25 changes: 25 additions & 0 deletions
25
fleet_vehicle_service_kanban/models/fleet_vehicle_log_services_stage.py
This file contains 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-Present Druidoo - Manuel Marquez <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class FleetVehicleLogServicesStage(models.Model): | ||
_name = "fleet.vehicle.log.services.stage" | ||
_order = "sequence asc" | ||
_description = "Vehicle Services Stages" | ||
|
||
name = fields.Char(required=True, translate=True) | ||
sequence = fields.Integer(help="Used to order the stages") | ||
fold = fields.Boolean( | ||
string="Folded in Kanban", | ||
help="If True this stage is folded in the kanban view.", | ||
) | ||
|
||
_sql_constraints = [ | ||
( | ||
"fleet_service_stage_name_unique", | ||
"unique(name)", | ||
"Stage name already exists", | ||
) | ||
] |
16 changes: 16 additions & 0 deletions
16
fleet_vehicle_service_kanban/models/fleet_vehicle_log_services_tag.py
This file contains 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,16 @@ | ||
# Copyright 2020-Present Druidoo - Manuel Marquez <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class FleetVehicleLogServicesTag(models.Model): | ||
_name = "fleet.vehicle.log.services.tag" | ||
_description = "Services Tags" | ||
|
||
name = fields.Char("Tag Name", required=True, translate=True) | ||
color = fields.Integer("Color Index") | ||
|
||
_sql_constraints = [ | ||
("name_uniq", "unique (name)", "Tag name already exists !"), | ||
] |
This file contains 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,8 @@ | ||
* `Druidoo <https://www.druidoo.io>`_: | ||
|
||
* Iván Todorovich <[email protected]> | ||
* Manuel Marquez <[email protected]> | ||
|
||
* `PnLUG - Gruppo Odoo <https://odoo.pnlug.it>`_: | ||
|
||
* Stefano Consolaro <[email protected]> (backport 13.0→12.0) |
This file contains 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,8 @@ | ||
This module adds the following features to vehicle services (fleet.vehicle.log.service): | ||
|
||
- Kanban view. | ||
- Features of mail (chatter) and acitivities, includes a new activity view. | ||
- Configurable activity types. Menu under `Fleet / Configuration / Services Logs / Activity Types`. | ||
- New fields: Responsible, Priority, Tags, Active, Stage. | ||
- Configurable stages. Menu under `Fleet / Configuration / Services Logs / Vehicle Services Stages`. | ||
- Configurable tags. Menu under `Fleet / Configuration / Services Logs / Vehicle Services Tags`. |
This file contains 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,5 @@ | ||
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | ||
fleet_vehicle_log_services_stage_access_right_user,fleet_vehicle_log_services_stage_access_right_user,model_fleet_vehicle_log_services_stage,fleet.fleet_group_user,1,0,0,0 | ||
fleet_vehicle_log_services_stage_access_right_manager,fleet_vehicle_log_services_stage_access_right_manager,model_fleet_vehicle_log_services_stage,fleet.fleet_group_manager,1,1,1,1 | ||
fleet_vehicle_log_services_tag_access_right_user,fleet_vehicle_log_services_tag_access_right_user,model_fleet_vehicle_log_services_tag,fleet.fleet_group_user,1,0,0,0 | ||
fleet_vehicle_log_services_tag_access_right_manager,fleet_vehicle_log_services_tag_access_right_manager,model_fleet_vehicle_log_services_tag,fleet.fleet_group_manager,1,1,1,1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.