forked from OCA/field-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] Templates [WIP] Testing [IMP] FSM Emails [ADD] FSM Stage Server Action [IMP] ir.server.action in pavlov_media [IMP] Remove dependency conflict [IMP] Cite OCA manifest [IMP] Remove Dependency [IMP] Auto Config for User [IMP] Small changes [FIX] fieldservice (PM OCA#515 and OCA#577) (OCA#230) [IMP] fieldservice: Add notes on location (PM OCA#596) (OCA#231) [FIX] fieldservice_agreement (OCA#232) [ADD] fieldservice_stage_server_action
- Loading branch information
1 parent
c57c61e
commit 22323d6
Showing
22 changed files
with
922 additions
and
4 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 |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
'web_timeline', | ||
'resource', | ||
'contacts', | ||
'partner_fax' | ||
], | ||
'data': [ | ||
'data/ir_sequence.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
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 (C) 2019 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_fsm_wizard |
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,111 @@ | ||
# Copyright (C) 2019 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class FieldServiceTransactionCase(TransactionCase): | ||
""" | ||
Test used to check that the base functionalities of Field Service. | ||
- test_convert_location: tests that a res.partner can be converted | ||
into a fsm.location. | ||
- test_convert_person: tests that a res.partner can be converted into | ||
a fsm.person. | ||
- test_convert_sublocation: tests that the sub-contacts on a | ||
res.partner are converted into Other Addresses. | ||
""" | ||
def setUp(self): | ||
super(FieldServiceTransactionCase, self).setUp() | ||
# create a Res Partner | ||
self.test_partner = self.env['res.partner'].\ | ||
create({ | ||
'name': 'Test Partner', | ||
'phone': '123', | ||
'email': 'tp@email.com', | ||
}) | ||
# create a Res Partner to be converted to FSM Location/Person | ||
self.test_loc_partner = self.env['res.partner'].\ | ||
create({ | ||
'name': 'Test Loc Partner', | ||
'phone': 'ABC', | ||
'email': 'tlp@email.com', | ||
}) | ||
# create expected FSM Location to compare to converted FSM Location | ||
self.test_location = self.env['fsm.location'].\ | ||
create({ | ||
'name': 'Test Location', | ||
'phone': '123', | ||
'email': 'tp@email.com', | ||
'partner_id': self.test_loc_partner.id, | ||
'owner_id': self.test_loc_partner.id, | ||
'customer_id': self.test_loc_partner.id, | ||
}) | ||
# create expected FSM Person to compare to converted FSM Person | ||
self.test_person = self.env['fsm.person'].\ | ||
create({ | ||
'name': 'Test Person', | ||
'phone': '123', | ||
'email': 'tp@email.com', | ||
}) | ||
self.test_wizard = self.env['fsm.wizard'] | ||
|
||
def test_convert_location(self): | ||
# convert test_partner to FSM Location | ||
self.test_wizard.action_convert_location(self.test_partner) | ||
|
||
# check if there is a new FSM Location with name 'Test Partner' | ||
self.wiz_location = self.env['fsm.location'].\ | ||
search([('name', '=', 'Test Partner')]) | ||
|
||
# check if 'Test Partner' creation successful and fields copied over | ||
self.assertEqual(self.test_location.phone, self.wiz_location.phone) | ||
self.assertEqual(self.test_location.email, self.wiz_location.email) | ||
|
||
def test_convert_person(self): | ||
# convert test_partner to FSM Person | ||
self.test_wizard.action_convert_person(self.test_partner) | ||
|
||
# check if there is a new FSM Person with name 'Test Partner' | ||
self.wiz_person = self.env['fsm.person'].\ | ||
search([('name', '=', 'Test Partner')]) | ||
|
||
# check if 'Test Partner' creation successful and fields copied over | ||
self.assertEqual(self.test_person.phone, self.wiz_person.phone) | ||
self.assertEqual(self.test_person.email, self.wiz_person.email) | ||
|
||
def test_convert_sublocation(self): | ||
# create 4 Res Partners each with different type | ||
s1 = self.env['res.partner'].create({ | ||
'name': 'sub partner 1', | ||
'type': 'contact' | ||
}) | ||
s2 = self.env['res.partner'].create({ | ||
'name': 'sub partner 2', | ||
'type': 'invoice' | ||
}) | ||
s3 = self.env['res.partner'].create({ | ||
'name': 'sub partner 3', | ||
'type': 'delivery' | ||
}) | ||
s4 = self.env['res.partner'].create({ | ||
'name': 'sub partner 4', | ||
'type': 'private' | ||
}) | ||
|
||
# create parent Res Partner and assign its children | ||
children = [s1.id, s2.id, s3.id, s4.id] | ||
parent = s1 = self.env['res.partner'].create({ | ||
'name': 'Parent Partner', | ||
'child_ids': [(6, 0, children)] | ||
}) | ||
|
||
# convert Parent Partner to FSM Location | ||
self.test_wizard.action_convert_location(parent) | ||
|
||
# check if 'Parent Partner' creation successful and fields copied over | ||
wiz_parent = self.env['fsm.location'].\ | ||
search([('name', '=', 'Parent Partner')]) | ||
|
||
# check all children were assigned type 'other' | ||
for child in wiz_parent.child_ids: | ||
self.assertEqual(child.type, 'other') |
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
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
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
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
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
from . import ( | ||
agreement, | ||
fsm_equipment, | ||
fsm_location, | ||
fsm_order, | ||
fsm_person | ||
fsm_person, | ||
) |
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 (C) 2018 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class FSMLocation(models.Model): | ||
_inherit = 'fsm.location' | ||
|
||
serviceprofile_ids = fields.Many2many('agreement.serviceprofile', | ||
string="Service Profiles", | ||
compute='_compute_service_ids') | ||
|
||
@api.multi | ||
def _compute_service_ids(self): | ||
for loc in self: | ||
agreements = self.env['agreement'].\ | ||
search([('fsm_location_id', '=', self.name)]) | ||
ids = [] | ||
for agree in agreements: | ||
servpros = self.env['agreement.serviceprofile'].\ | ||
search([('agreement_id', '=', agree.id)]) | ||
for ser in servpros: | ||
if ser.id not in ids: | ||
ids.append(ser.id) | ||
self.serviceprofile_ids = ids |
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,24 @@ | ||
<!-- Copyright 2019 Open Source Integrators | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) --> | ||
<odoo> | ||
|
||
<record id="fsm_location_agreement_serviceprofile" model="ir.ui.view"> | ||
<field name="name">fsm.location.agreement.serviceprofile</field> | ||
<field name="model">fsm.location</field> | ||
<field name="inherit_id" ref="fieldservice.fsm_location_form_view"/> | ||
<field name="arch" type="xml"> | ||
<notebook position="inside"> | ||
<page string="Service Profiles"> | ||
<field name="serviceprofile_ids"> | ||
<tree> | ||
<field name="name"/> | ||
<field name="agreement_id"/> | ||
<field name="notes"/> | ||
</tree> | ||
</field> | ||
</page> | ||
</notebook> | ||
</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,120 @@ | ||
=================================== | ||
Field Service - Stage Server Action | ||
=================================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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%2Ffield--service-lightgray.png?logo=github | ||
:target: https://github.com/OCA/field-service/tree/12.0/fieldservice_skill | ||
:alt: OCA/field-service | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/field-service-12-0/field-service-12-0-fieldservice_skill | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/264/12.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
|
||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Installation | ||
============ | ||
|
||
To install Field Service and have the mapping features, you need to install GeoEngine. | ||
|
||
Please refer to the installation instructions available at: | ||
https://github.com/OCA/geospatial/tree/12.0/base_geoengine | ||
|
||
Configuration | ||
============= | ||
|
||
To configure this module, you need to: | ||
|
||
|
||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
The roadmap of the Field Service application is documented on | ||
`Github <https://github.com/OCA/field-service/issues/1>`_. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/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/field-service/issues/new?body=module:%20fieldservice_skill%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 | ||
~~~~~~~ | ||
|
||
* Open Source Integrators | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Wolfgang Hall <whall@opensourceintegrators.com> | ||
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com> | ||
* Steve Campbell <scampbell@opensourceintegrators.com> | ||
|
||
Other credits | ||
~~~~~~~~~~~~~ | ||
|
||
The development of this module has been financially supported by: | ||
|
||
* Open Source Integrators <https://opensourceintegrators.com> | ||
|
||
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-osi-scampbell| image:: https://github.com/osi-scampbell.png?size=40px | ||
:target: https://github.com/osi-scampbell | ||
:alt: osi-scampbell | ||
.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px | ||
:target: https://github.com/max3903 | ||
:alt: max3903 | ||
|
||
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-osi-scampbell| |maintainer-max3903| | ||
|
||
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/12.0/fieldservice_skill>`_ 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 (C) 2019 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
Oops, something went wrong.