diff --git a/agreement_legal_sale/README.rst b/agreement_legal_sale/README.rst new file mode 100644 index 00000000..34babcb4 --- /dev/null +++ b/agreement_legal_sale/README.rst @@ -0,0 +1,131 @@ +==================== +Agreement Legal Sale +==================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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| + +Odoo Sales App does not support the management of legal content for agreements +and contracts. It's also not integrated with the Agreement App. + +This module is for companies that needs their customer to sign an agreement +with all the legal information based on the selected agreement template. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module: + +* Go to Agreement > Configuration > Templates +* Create a new template with sections and clauses and their respective content +* Go to Agreement > Configuration > Stages +* Create and reorder stages to match your process + +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: + + * the agreement template is copied into an agreement with a copy of the + sections, clauses, recitals and appendices + * all the sales order lines are added as agreement lines + * the products on the SO with BOM are added as service profile on the agreement + * the customer information is set from the sales order + * the eventual analytic account linked to the sales order is set on the agreement + * the agreement is linked to the sales order and vice versa + +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 +* Serpent Consulting Services Pvt. Ltd. + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Pavlov Media +* 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/__init__.py b/agreement_legal_sale/__init__.py new file mode 100644 index 00000000..69f7babd --- /dev/null +++ b/agreement_legal_sale/__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/__manifest__.py b/agreement_legal_sale/__manifest__.py new file mode 100644 index 00000000..7ed16142 --- /dev/null +++ b/agreement_legal_sale/__manifest__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2019 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Agreement Legal Sale', + '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', + 'agreement_sale', + ], + 'data': [ + 'views/agreement.xml', + 'views/product.xml', + 'views/sale_order.xml', + ], + 'installable': True, + 'development_status': 'Beta', + 'maintainers': [ + 'osi-scampbell', + 'max3903', + ], +} diff --git a/agreement_legal_sale/i18n/agreement_sale.pot b/agreement_legal_sale/i18n/agreement_sale.pot new file mode 100644 index 00000000..e0846561 --- /dev/null +++ b/agreement_legal_sale/i18n/agreement_sale.pot @@ -0,0 +1,64 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_sale_order_agreement_id +#: model:ir.ui.view,arch_db:agreement_sale.product_template_form_view +msgid "Agreement" +msgstr "" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_sale_order_agreement_template_id +msgid "Agreement Template" +msgstr "" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_product_product_is_serviceprofile +#: model:ir.model.fields,field_description:agreement_sale.field_product_template_is_serviceprofile +msgid "Create a Service Profile" +msgstr "" + +#. module: agreement_sale +#: model:ir.model.fields,help:agreement_sale.field_product_product_is_serviceprofile +#: model:ir.model.fields,help:agreement_sale.field_product_template_is_serviceprofile +msgid "If True, this product will create a service profile on the\n" +" agreement when the sales order is confirmed." +msgstr "" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_product_template +msgid "Product Template" +msgstr "" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_sale_order +msgid "Quotation" +msgstr "" + +#. module: agreement_sale +#: model:ir.ui.view,arch_db:agreement_sale.agreement_sale_form_view +msgid "Sales" +msgstr "" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_agreement_sale_id +msgid "Sales Order" +msgstr "" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_agreement +msgid "agreement" +msgstr "" + diff --git a/agreement_legal_sale/i18n/de.po b/agreement_legal_sale/i18n/de.po new file mode 100644 index 00000000..76c547cf --- /dev/null +++ b/agreement_legal_sale/i18n/de.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-02-22 14:50+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.4\n" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_sale_order_agreement_id +#: model:ir.ui.view,arch_db:agreement_sale.product_template_form_view +msgid "Agreement" +msgstr "Vereinbarung" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_sale_order_agreement_template_id +msgid "Agreement Template" +msgstr "Vereinbarungsvorlage" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_product_product_is_serviceprofile +#: model:ir.model.fields,field_description:agreement_sale.field_product_template_is_serviceprofile +msgid "Create a Service Profile" +msgstr "Dienstleistungsprofil erstellen" + +#. module: agreement_sale +#: model:ir.model.fields,help:agreement_sale.field_product_product_is_serviceprofile +#: model:ir.model.fields,help:agreement_sale.field_product_template_is_serviceprofile +msgid "" +"If True, this product will create a service profile on the\n" +" agreement when the sales order is confirmed." +msgstr "" +"Wenn der Haken gesetzt ist, wird dieses Produkt ein Dienstleistungsprofil in " +"der Vereinbarung erzeugen, sobald der Verkaufsauftrag bestätigt wird." + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_product_template +msgid "Product Template" +msgstr "Produktvorlage" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_sale_order +msgid "Quotation" +msgstr "Angebot" + +#. module: agreement_sale +#: model:ir.ui.view,arch_db:agreement_sale.agreement_sale_form_view +msgid "Sales" +msgstr "Verkauf" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_agreement_sale_id +msgid "Sales Order" +msgstr "Verkaufsauftrag" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_agreement +msgid "agreement" +msgstr "Vereinbarung" diff --git a/agreement_legal_sale/models/__init__.py b/agreement_legal_sale/models/__init__.py new file mode 100644 index 00000000..2f3b40d7 --- /dev/null +++ b/agreement_legal_sale/models/__init__.py @@ -0,0 +1,7 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + sale_order, + agreement, + product, +) diff --git a/agreement_legal_sale/models/agreement.py b/agreement_legal_sale/models/agreement.py new file mode 100644 index 00000000..6e064886 --- /dev/null +++ b/agreement_legal_sale/models/agreement.py @@ -0,0 +1,20 @@ +# Copyright (C) 2019 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class Agreement(models.Model): + _inherit = 'agreement' + + sale_id = fields.Many2one('sale.order', string='Sales Order') + analytic_account_id = fields.Many2one( + 'account.analytic.account', 'Analytic Account', readonly=True, + copy=False) + + +class AgreementLine(models.Model): + _inherit = "agreement.line" + + sale_line_id = fields.Many2one('sale.order.line', + string='Sales Order Line') diff --git a/agreement_legal_sale/models/product.py b/agreement_legal_sale/models/product.py new file mode 100644 index 00000000..59d7c8f0 --- /dev/null +++ b/agreement_legal_sale/models/product.py @@ -0,0 +1,13 @@ +# Copyright (C) 2019 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + is_serviceprofile = fields.Boolean( + string="Create a Service Profile", + help="""If True, this product will create a service profile on the + agreement when the sales order is confirmed.""") diff --git a/agreement_legal_sale/models/sale_order.py b/agreement_legal_sale/models/sale_order.py new file mode 100644 index 00000000..a6713a61 --- /dev/null +++ b/agreement_legal_sale/models/sale_order.py @@ -0,0 +1,45 @@ +# Copyright (C) 2019 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class SaleOrder(models.Model): + _inherit = 'sale.order' + + agreement_template_id = fields.Many2one( + 'agreement', + string="Agreement Template", + domain="[('is_template', '=', True)]") + + @api.multi + def _action_confirm(self): + res = super(SaleOrder, self)._action_confirm() + for order in self: + if order.agreement_template_id: + order.agreement_id = order.agreement_template_id.copy(default={ + 'name': order.name, + 'code': order.name, + 'is_template': False, + 'sale_id': order.id, + 'partner_id': order.partner_id.id, + 'analytic_account_id': order.analytic_account_id and + order.analytic_account_id.id or False, + }) + for line in order.order_line: + # Create agreement line + self.env['agreement.line'].create({ + 'product_id': line.product_id.id, + 'name': line.name, + 'agreement_id': order.agreement_id.id, + 'qty': line.product_uom_qty, + 'sale_line_id': line.id, + 'uom_id': line.product_uom.id + }) + # If the product is a service profile, create one + if line.product_id.product_tmpl_id.is_serviceprofile: + self.env['agreement.serviceprofile'].create({ + 'name': line.name, + 'agreement_id': order.agreement_id.id, + }) + return res diff --git a/agreement_legal_sale/readme/CONFIGURE.rst b/agreement_legal_sale/readme/CONFIGURE.rst new file mode 100644 index 00000000..3871fc34 --- /dev/null +++ b/agreement_legal_sale/readme/CONFIGURE.rst @@ -0,0 +1,6 @@ +To configure this module: + +* Go to Agreement > Configuration > Templates +* Create a new template with sections and clauses and their respective content +* Go to Agreement > Configuration > Stages +* Create and reorder stages to match your process diff --git a/agreement_legal_sale/readme/CONTRIBUTORS.rst b/agreement_legal_sale/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..364a1729 --- /dev/null +++ b/agreement_legal_sale/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Steven Campbell +* Maxime Chambreuil +* Serpent Consulting Services Pvt. Ltd. diff --git a/agreement_legal_sale/readme/CREDITS.rst b/agreement_legal_sale/readme/CREDITS.rst new file mode 100644 index 00000000..0543afe7 --- /dev/null +++ b/agreement_legal_sale/readme/CREDITS.rst @@ -0,0 +1,4 @@ +The development of this module has been financially supported by: + +* Pavlov Media +* Open Source Integrators diff --git a/agreement_legal_sale/readme/DESCRIPTION.rst b/agreement_legal_sale/readme/DESCRIPTION.rst new file mode 100644 index 00000000..642b7de2 --- /dev/null +++ b/agreement_legal_sale/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +Odoo Sales App does not support the management of legal content for agreements +and contracts. It's also not integrated with the Agreement App. + +This module is for companies that needs their customer to sign an agreement +with all the legal information based on the selected agreement template. diff --git a/agreement_legal_sale/readme/ROADMAP.rst b/agreement_legal_sale/readme/ROADMAP.rst new file mode 100644 index 00000000..c6d54c4f --- /dev/null +++ b/agreement_legal_sale/readme/ROADMAP.rst @@ -0,0 +1 @@ +The roadmap is documented on https://github.com/OCA/contract/issues. diff --git a/agreement_legal_sale/readme/USAGE.rst b/agreement_legal_sale/readme/USAGE.rst new file mode 100644 index 00000000..259af0b9 --- /dev/null +++ b/agreement_legal_sale/readme/USAGE.rst @@ -0,0 +1,14 @@ +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: + + * the agreement template is copied into an agreement with a copy of the + sections, clauses, recitals and appendices + * all the sales order lines are added as agreement lines + * the products on the SO with BOM are added as service profile on the agreement + * the customer information is set from the sales order + * the eventual analytic account linked to the sales order is set on the agreement + * the agreement is linked to the sales order and vice versa diff --git a/agreement_legal_sale/static/description/icon.png b/agreement_legal_sale/static/description/icon.png new file mode 100644 index 00000000..23ce9313 Binary files /dev/null and b/agreement_legal_sale/static/description/icon.png differ diff --git a/agreement_legal_sale/static/description/index.html b/agreement_legal_sale/static/description/index.html new file mode 100644 index 00000000..d1347a99 --- /dev/null +++ b/agreement_legal_sale/static/description/index.html @@ -0,0 +1,470 @@ + + + + + + +Agreement - Sale + + + +
+

Agreement - Sale

+ + +

Beta License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runbot

+

Odoo Sales App does not support the management of legal content for agreements +and contracts. It’s also not integrated with the Agreement App.

+

This module is for companies that needs their customer to sign an agreement +with all the legal information based on the selected agreement template.

+

Table of contents

+ +
+

Configuration

+

To configure this module:

+
    +
  • Go to Agreement > Configuration > Templates
  • +
  • Create a new template with sections and clauses and their respective content
  • +
  • Go to Agreement > Configuration > Stages
  • +
  • Create and reorder stages to match your process
  • +
+
+
+

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:
      +
    • the agreement template is copied into an agreement with a copy of the +sections, clauses, recitals and appendices
    • +
    • all the sales order lines are added as agreement lines
    • +
    • the products on the SO with BOM are added as service profile on the agreement
    • +
    • the customer information is set from the sales order
    • +
    • the eventual analytic account linked to the sales order is set on the agreement
    • +
    • the agreement is linked to the sales order and vice versa
    • +
    +
  • +
+
+ +
+

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
  • +
+
+ +
+

Other credits

+

The development of this module has been financially supported by:

+
    +
  • Pavlov Media
  • +
  • Open Source Integrators
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainers:

+

osi-scampbell 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/views/agreement.xml b/agreement_legal_sale/views/agreement.xml new file mode 100644 index 00000000..dffaee97 --- /dev/null +++ b/agreement_legal_sale/views/agreement.xml @@ -0,0 +1,29 @@ + + + + + + + agreement.form.view + agreement + + + + + + + + + + + + + + + + + + + diff --git a/agreement_legal_sale/views/product.xml b/agreement_legal_sale/views/product.xml new file mode 100644 index 00000000..54fa92cb --- /dev/null +++ b/agreement_legal_sale/views/product.xml @@ -0,0 +1,25 @@ + + + + + + + product.template.form.view + product.template + + + + + + + + + + + + + + + + diff --git a/agreement_legal_sale/views/sale_order.xml b/agreement_legal_sale/views/sale_order.xml new file mode 100644 index 00000000..8b607a89 --- /dev/null +++ b/agreement_legal_sale/views/sale_order.xml @@ -0,0 +1,23 @@ + + + + + + + sale.order.agreement.form.view + sale.order + + + + + + + + + + + +