diff --git a/agreement_legal_sale_fieldservice/README.rst b/agreement_legal_sale_fieldservice/README.rst new file mode 100644 index 000000000..8f8adc941 --- /dev/null +++ b/agreement_legal_sale_fieldservice/README.rst @@ -0,0 +1,113 @@ +================================= +Agreement Legal Sale Fieldservice +================================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fcontract-lightgray.png?logo=github + :target: https://github.com/OCA/contract/tree/12.0/agreement_legal_sale + :alt: OCA/contract +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_legal_sale + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/110/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +After creating an Agreement from a Sales Order we need to +link it the Fieldservice Location of the Partner so users do +not have to do so manually. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module: + +* Go to Sales +* Create or select a quotation +* Set the agreement template and add some products +* Confirm the quotation. +* An agreement is created and linked to the sales order and + the partner's fsm_location is linked to the agreement + + +Known issues / Roadmap +====================== + +The roadmap is documented on https://github.com/OCA/contract/issues. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Open Source Integrators + +Contributors +~~~~~~~~~~~~ + +* Steven Campbell +* Maxime Chambreuil + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Amplex Internet +* Open Source Integrators + +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 `__: + +|maintainer-osi-scampbell| |maintainer-max3903| + +This module is part of the `OCA/contract `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/agreement_legal_sale_fieldservice/__init__.py b/agreement_legal_sale_fieldservice/__init__.py new file mode 100644 index 000000000..69f7babdf --- /dev/null +++ b/agreement_legal_sale_fieldservice/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/agreement_legal_sale_fieldservice/__manifest__.py b/agreement_legal_sale_fieldservice/__manifest__.py new file mode 100644 index 000000000..e8b709921 --- /dev/null +++ b/agreement_legal_sale_fieldservice/__manifest__.py @@ -0,0 +1,26 @@ +# Copyright (C) 2019 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Agreement Legal Sale Fieldservice', + 'summary': 'Create an agreement when the sale order is confirmed', + 'version': '12.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'Open Source Integrators, Odoo Community Association (OCA)', + 'category': 'Agreement', + 'website': 'https://github.com/OCA/contract', + 'depends': [ + 'agreement_legal_sale', + 'fieldservice_agreement', + 'fieldservice_sale' + ], + 'data': [ + ], + 'installable': True, + 'development_status': 'Beta', + 'maintainers': [ + 'osi-scampbell', + 'max3903', + ], + 'auto_install': True +} diff --git a/agreement_legal_sale_fieldservice/models/__init__.py b/agreement_legal_sale_fieldservice/models/__init__.py new file mode 100644 index 000000000..c83f1d82a --- /dev/null +++ b/agreement_legal_sale_fieldservice/models/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + sale_order, +) diff --git a/agreement_legal_sale_fieldservice/models/sale_order.py b/agreement_legal_sale_fieldservice/models/sale_order.py new file mode 100644 index 000000000..a8367881d --- /dev/null +++ b/agreement_legal_sale_fieldservice/models/sale_order.py @@ -0,0 +1,18 @@ +# Copyright (C) 2019 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class SaleOrder(models.Model): + _inherit = 'sale.order' + + @api.multi + def _action_confirm(self): + res = super(SaleOrder, self)._action_confirm() + for order in self: + agreement_id = self.env['agreement'].\ + search([('sale_id', '=', order.id)]) + agreement_id.fsm_location_id = order.partner_id.\ + service_location_id + return res diff --git a/agreement_legal_sale_fieldservice/readme/CONTRIBUTORS.rst b/agreement_legal_sale_fieldservice/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..db3894eed --- /dev/null +++ b/agreement_legal_sale_fieldservice/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Steven Campbell +* Maxime Chambreuil diff --git a/agreement_legal_sale_fieldservice/readme/CREDITS.rst b/agreement_legal_sale_fieldservice/readme/CREDITS.rst new file mode 100644 index 000000000..0a523d59a --- /dev/null +++ b/agreement_legal_sale_fieldservice/readme/CREDITS.rst @@ -0,0 +1,4 @@ +The development of this module has been financially supported by: + +* Amplex Internet +* Open Source Integrators diff --git a/agreement_legal_sale_fieldservice/readme/DESCRIPTION.rst b/agreement_legal_sale_fieldservice/readme/DESCRIPTION.rst new file mode 100644 index 000000000..6096a5009 --- /dev/null +++ b/agreement_legal_sale_fieldservice/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +After creating an Agreement from a Sales Order we need to +link it the Fieldservice Location of the Partner so users do +not have to do so manually. diff --git a/agreement_legal_sale_fieldservice/readme/ROADMAP.rst b/agreement_legal_sale_fieldservice/readme/ROADMAP.rst new file mode 100644 index 000000000..c6d54c4f5 --- /dev/null +++ b/agreement_legal_sale_fieldservice/readme/ROADMAP.rst @@ -0,0 +1 @@ +The roadmap is documented on https://github.com/OCA/contract/issues. diff --git a/agreement_legal_sale_fieldservice/readme/USAGE.rst b/agreement_legal_sale_fieldservice/readme/USAGE.rst new file mode 100644 index 000000000..0b805d5c7 --- /dev/null +++ b/agreement_legal_sale_fieldservice/readme/USAGE.rst @@ -0,0 +1,8 @@ +To use this module: + +* Go to Sales +* Create or select a quotation +* Set the agreement template and add some products +* Confirm the quotation. +* An agreement is created and linked to the sales order and + the partner's fsm_location is linked to the agreement diff --git a/agreement_legal_sale_fieldservice/static/description/icon.png b/agreement_legal_sale_fieldservice/static/description/icon.png new file mode 100644 index 000000000..a99cce6be Binary files /dev/null and b/agreement_legal_sale_fieldservice/static/description/icon.png differ diff --git a/agreement_legal_sale_fieldservice/static/description/index.html b/agreement_legal_sale_fieldservice/static/description/index.html new file mode 100644 index 000000000..1aa0ee8a5 --- /dev/null +++ b/agreement_legal_sale_fieldservice/static/description/index.html @@ -0,0 +1,471 @@ + + + + + + +Agreement Legal Sale + + + + + + diff --git a/oca_dependencies.txt b/oca_dependencies.txt index d7f9e901f..bf5df9e95 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1,3 +1,3 @@ bank-payment queue - +field-service