diff --git a/agreement_legal_sale/README.rst b/agreement_legal_sale/README.rst new file mode 100644 index 00000000..e916c4b3 --- /dev/null +++ b/agreement_legal_sale/README.rst @@ -0,0 +1,138 @@ +==================== +Agreement Legal Sale +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:56733c20e702eb98a24373cd239a8110683ac4e3ccec99f7189746b277516b20 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fagreement-lightgray.png?logo=github + :target: https://github.com/OCA/agreement/tree/16.0/agreement_legal_sale + :alt: OCA/agreement +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/agreement-16-0/agreement-16-0-agreement_legal_sale + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/agreement&target_branch=16.0 + :alt: Try me on Runboat + +|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 service products (with is_serviceprofile = True) on the SO 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 to smash 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. + +* `Binhex `_: + + * Adasat Torres de León + +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/agreement `_ 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..b36ca47e --- /dev/null +++ b/agreement_legal_sale/__manifest__.py @@ -0,0 +1,23 @@ +# 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": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Open Source Integrators, Odoo Community Association (OCA)", + "category": "Agreement", + "website": "https://github.com/OCA/agreement", + "depends": ["agreement_legal", "agreement_sale", "agreement_serviceprofile"], + "data": [ + "views/agreement.xml", + "views/sale_order.xml", + ], + "installable": True, + "development_status": "Beta", + "maintainers": [ + "osi-scampbell", + "max3903", + ], +} diff --git a/agreement_legal_sale/i18n/agreement_legal_sale.pot b/agreement_legal_sale/i18n/agreement_legal_sale.pot new file mode 100644 index 00000000..0363414c --- /dev/null +++ b/agreement_legal_sale/i18n/agreement_legal_sale.pot @@ -0,0 +1,71 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_legal_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement +msgid "Agreement" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement_line +msgid "Agreement Lines" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__agreement_template_id +msgid "Agreement Template" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__analytic_account_id +msgid "Analytic Account" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__display_name +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__display_name +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__display_name +msgid "Display Name" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__id +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__id +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__id +msgid "ID" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement____last_update +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line____last_update +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order____last_update +msgid "Last Modified on" +msgstr "" + +#. module: agreement_legal_sale +#: model_terms:ir.ui.view,arch_db:agreement_legal_sale.agreement_sale_form_view +msgid "Sales" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_sale_order +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__sale_id +msgid "Sales Order" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__sale_line_id +msgid "Sales Order Line" +msgstr "" 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..1e9417c8 --- /dev/null +++ b/agreement_legal_sale/i18n/de.po @@ -0,0 +1,76 @@ +# 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-05-10 14:03+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.5.1\n" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement +msgid "Agreement" +msgstr "Vereinbarung" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement_line +msgid "Agreement Lines" +msgstr "Vereinbarungspositionen" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__agreement_template_id +msgid "Agreement Template" +msgstr "Vereinbarungsvorlage" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__analytic_account_id +msgid "Analytic Account" +msgstr "Kostenstelle" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_sale_order +msgid "Sale Order" +msgstr "Verkaufsauftrag" + +#. module: agreement_legal_sale +#: model_terms:ir.ui.view,arch_db:agreement_legal_sale.agreement_sale_form_view +msgid "Sales" +msgstr "Verkauf" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__sale_id +msgid "Sales Order" +msgstr "Verkaufsauftrag" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__sale_line_id +msgid "Sales Order Line" +msgstr "Auftragszeile" + +#~ msgid "Create a Service Profile" +#~ msgstr "Dienstleistungsprofil erstellen" + +#~ 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." + +#~ msgid "Product Template" +#~ msgstr "Produktvorlage" + +#~ msgid "Quotation" +#~ msgstr "Angebot" + +#~ msgid "agreement" +#~ msgstr "Vereinbarung" diff --git a/agreement_legal_sale/i18n/es.po b/agreement_legal_sale/i18n/es.po new file mode 100644 index 00000000..eb974df9 --- /dev/null +++ b/agreement_legal_sale/i18n/es.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_legal_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es\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" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement +msgid "Agreement" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement_line +msgid "Agreement Lines" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__agreement_template_id +msgid "Agreement Template" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__analytic_account_id +msgid "Analytic Account" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_sale_order +msgid "Sale Order" +msgstr "" + +#. module: agreement_legal_sale +#: model_terms:ir.ui.view,arch_db:agreement_legal_sale.agreement_sale_form_view +msgid "Sales" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__sale_id +msgid "Sales Order" +msgstr "" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__sale_line_id +msgid "Sales Order Line" +msgstr "" diff --git a/agreement_legal_sale/i18n/es_AR.po b/agreement_legal_sale/i18n/es_AR.po new file mode 100644 index 00000000..bd90c094 --- /dev/null +++ b/agreement_legal_sale/i18n/es_AR.po @@ -0,0 +1,74 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_legal_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-02-06 20:59+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\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 4.3.2\n" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement +msgid "Agreement" +msgstr "Acuerdo" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement_line +msgid "Agreement Lines" +msgstr "Líneas de Acuerdo" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__agreement_template_id +msgid "Agreement Template" +msgstr "Plantilla de Acuerdo" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__analytic_account_id +msgid "Analytic Account" +msgstr "Cuenta Analítica" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__display_name +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__display_name +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__id +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__id +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__id +msgid "ID" +msgstr "ID" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement____last_update +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line____last_update +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order____last_update +msgid "Last Modified on" +msgstr "Última Modificación el" + +#. module: agreement_legal_sale +#: model_terms:ir.ui.view,arch_db:agreement_legal_sale.agreement_sale_form_view +msgid "Sales" +msgstr "Ventas" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_sale_order +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__sale_id +msgid "Sales Order" +msgstr "Pedido de Venta" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__sale_line_id +msgid "Sales Order Line" +msgstr "Línea de Pedido de Venta" diff --git a/agreement_legal_sale/i18n/fr.po b/agreement_legal_sale/i18n/fr.po new file mode 100644 index 00000000..aee504b0 --- /dev/null +++ b/agreement_legal_sale/i18n/fr.po @@ -0,0 +1,70 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_legal_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-04-19 17:15+0000\n" +"Last-Translator: Yves Goldberg \n" +"Language-Team: none\n" +"Language: fr\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.5.1\n" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement +msgid "Agreement" +msgstr "Accord" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement_line +msgid "Agreement Lines" +msgstr "Lignes de l'accord" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__agreement_template_id +msgid "Agreement Template" +msgstr "Modèle d'accord" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__analytic_account_id +msgid "Analytic Account" +msgstr "Compte Analytique" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_sale_order +msgid "Sale Order" +msgstr "Commande" + +#. module: agreement_legal_sale +#: model_terms:ir.ui.view,arch_db:agreement_legal_sale.agreement_sale_form_view +msgid "Sales" +msgstr "Vente" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__sale_id +msgid "Sales Order" +msgstr "Commandes" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__sale_line_id +msgid "Sales Order Line" +msgstr "Ligne de commande" + +#~ msgid "Create a Service Profile" +#~ msgstr "Créer un profil de service" + +#~ msgid "" +#~ "If True, this product will create a service profile on the\n" +#~ " agreement when the sales order is confirmed." +#~ msgstr "" +#~ "Si Vrai, ce produit créera un profil de service dans\n" +#~ "          l'accord a la confirmation de la commande client." + +#~ msgid "Product Template" +#~ msgstr "Modèle Produit" diff --git a/agreement_legal_sale/i18n/pt.po b/agreement_legal_sale/i18n/pt.po new file mode 100644 index 00000000..117eb5be --- /dev/null +++ b/agreement_legal_sale/i18n/pt.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_legal_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-17 19:13+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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.10\n" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement +msgid "Agreement" +msgstr "Acordo" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement_line +msgid "Agreement Lines" +msgstr "Linhas de Acordo" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__agreement_template_id +msgid "Agreement Template" +msgstr "Modelo de Acordo" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__analytic_account_id +msgid "Analytic Account" +msgstr "Conta Analítica" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_sale_order +msgid "Sale Order" +msgstr "Encomenda de Venda" + +#. module: agreement_legal_sale +#: model_terms:ir.ui.view,arch_db:agreement_legal_sale.agreement_sale_form_view +msgid "Sales" +msgstr "Vendas" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__sale_id +msgid "Sales Order" +msgstr "Encomenda de Venda" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__sale_line_id +msgid "Sales Order Line" +msgstr "Linha de Encomenda de Venda" diff --git a/agreement_legal_sale/i18n/pt_BR.po b/agreement_legal_sale/i18n/pt_BR.po new file mode 100644 index 00000000..67ab1e59 --- /dev/null +++ b/agreement_legal_sale/i18n/pt_BR.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_legal_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-11-06 08:08+0000\n" +"Last-Translator: Eder Brito \n" +"Language-Team: none\n" +"Language: pt_BR\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.10\n" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement +msgid "Agreement" +msgstr "Acordo" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement_line +msgid "Agreement Lines" +msgstr "Linhas de Acordo" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__agreement_template_id +msgid "Agreement Template" +msgstr "Modelo de Acordo" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__analytic_account_id +msgid "Analytic Account" +msgstr "Conta Analítica" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_sale_order +msgid "Sale Order" +msgstr "Pedido de Venda" + +#. module: agreement_legal_sale +#: model_terms:ir.ui.view,arch_db:agreement_legal_sale.agreement_sale_form_view +msgid "Sales" +msgstr "Vendas" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__sale_id +msgid "Sales Order" +msgstr "Pedido de Vendas" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__sale_line_id +msgid "Sales Order Line" +msgstr "Linha do Pedido de Venda" diff --git a/agreement_legal_sale/i18n/zh_CN.po b/agreement_legal_sale/i18n/zh_CN.po new file mode 100644 index 00000000..f5a0b1dd --- /dev/null +++ b/agreement_legal_sale/i18n/zh_CN.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_legal_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-04 18:23+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement +msgid "Agreement" +msgstr "协议" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_agreement_line +msgid "Agreement Lines" +msgstr "协议行" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_sale_order__agreement_template_id +msgid "Agreement Template" +msgstr "协议模板" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__analytic_account_id +msgid "Analytic Account" +msgstr "分析账户" + +#. module: agreement_legal_sale +#: model:ir.model,name:agreement_legal_sale.model_sale_order +msgid "Sale Order" +msgstr "销售订单" + +#. module: agreement_legal_sale +#: model_terms:ir.ui.view,arch_db:agreement_legal_sale.agreement_sale_form_view +msgid "Sales" +msgstr "销售" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement__sale_id +msgid "Sales Order" +msgstr "销售订单" + +#. module: agreement_legal_sale +#: model:ir.model.fields,field_description:agreement_legal_sale.field_agreement_line__sale_line_id +msgid "Sales Order Line" +msgstr "销售订单行" + +#~ msgid "Create a Service Profile" +#~ msgstr "创建服务配置文件" + +#~ msgid "" +#~ "If True, this product will create a service profile on the\n" +#~ " agreement when the sales order is confirmed." +#~ msgstr "如果为真,则当确认销售订单时,此产品将在协议上创建服务配置文件。" + +#~ msgid "Product Template" +#~ msgstr "产品模版" diff --git a/agreement_legal_sale/models/__init__.py b/agreement_legal_sale/models/__init__.py new file mode 100644 index 00000000..fdabc477 --- /dev/null +++ b/agreement_legal_sale/models/__init__.py @@ -0,0 +1,6 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + sale_order, + agreement, +) diff --git a/agreement_legal_sale/models/agreement.py b/agreement_legal_sale/models/agreement.py new file mode 100644 index 00000000..456c03d1 --- /dev/null +++ b/agreement_legal_sale/models/agreement.py @@ -0,0 +1,19 @@ +# 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", 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/sale_order.py b/agreement_legal_sale/models/sale_order.py new file mode 100644 index 00000000..6f4af224 --- /dev/null +++ b/agreement_legal_sale/models/sale_order.py @@ -0,0 +1,80 @@ +# 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 SaleOrder(models.Model): + _inherit = "sale.order" + + agreement_template_id = fields.Many2one( + "agreement", string="Agreement Template", domain="[('is_template', '=', True)]" + ) + + def _action_confirm(self): + res = super()._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.filtered(lambda l: not l.display_type): + # Create agreement line + self.env["agreement.line"].create( + self._get_agreement_line_vals(line) + ) + # Create SP's based on product_id config + if line.product_id.is_serviceprofile: + self.create_sp_qty(line, order) + return res + + def create_sp_qty(self, line, order): + """Create line.product_uom_qty SP's""" + if line.product_id.product_tmpl_id.is_serviceprofile: + for i in range(1, int(line.product_uom_qty) + 1): + self.env["agreement.serviceprofile"].create( + self._get_sp_vals(line, order, i) + ) + + def _get_agreement_line_vals(self, line): + return { + "product_id": line.product_id.id, + "name": line.name, + "agreement_id": line.order_id.agreement_id.id, + "qty": line.product_uom_qty, + "sale_line_id": line.id, + "uom_id": line.product_uom.id, + } + + def _get_sp_vals(self, line, order, i): + return { + "name": line.name + " " + str(i), + "product_id": line.product_id.product_tmpl_id.id, + "agreement_id": order.agreement_id.id, + } + + def action_confirm(self): + # If sale_timesheet is installed, the _action_confirm() + # may be setting an Analytic Account on the SO. + # But since it is not a dependency, that can happen after + # we create the Agreement. + # To work around that, we check if that is the case, + # and make sure the SO Analytic Account is copied to the Agreement. + for order in self: + agreement = order.agreement_id + if ( + order.analytic_account_id + and agreement + and not agreement.analytic_account_id + ): + agreement.analytic_account_id = order.analytic_account_id + return super().action_confirm() 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..121866b9 --- /dev/null +++ b/agreement_legal_sale/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Steven Campbell +* Maxime Chambreuil +* Serpent Consulting Services Pvt. Ltd. + +* `Binhex `_: + + * Adasat Torres de León 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..990ad674 --- /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 service products (with is_serviceprofile = True) on the SO 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..a99cce6b 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..ef6573a3 --- /dev/null +++ b/agreement_legal_sale/static/description/index.html @@ -0,0 +1,479 @@ + + + + + +Agreement Legal Sale + + + + + + diff --git a/agreement_legal_sale/tests/__init__.py b/agreement_legal_sale/tests/__init__.py new file mode 100644 index 00000000..6f699d0d --- /dev/null +++ b/agreement_legal_sale/tests/__init__.py @@ -0,0 +1 @@ +from . import test_sale_order diff --git a/agreement_legal_sale/tests/test_sale_order.py b/agreement_legal_sale/tests/test_sale_order.py new file mode 100644 index 00000000..e545dfac --- /dev/null +++ b/agreement_legal_sale/tests/test_sale_order.py @@ -0,0 +1,141 @@ +# Copyright 2021 Ecosoft Co., Ltd (http://ecosoft.co.th) +# Copyright 2021 Sergio Teruel - Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from datetime import timedelta + +from odoo import fields +from odoo.tests.common import TransactionCase + + +class TestSaleOrder(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.test_customer = cls.env["res.partner"].create({"name": "TestCustomer"}) + cls.agreement_type = cls.env["agreement.type"].create( + { + "name": "Test Agreement Type", + "domain": "sale", + } + ) + cls.test_account_analytic_account = cls.env["account.analytic.account"].create( + {"name": "Test Analytic Account"} + ) + cls.test_agreement_template = cls.env["agreement"].create( + { + "name": "TestAgreementTemplate", + "description": "Test Template", + "special_terms": "Test Template", + "is_template": True, + "partner_id": cls.test_customer.id, + "start_date": fields.Date.today(), + "end_date": fields.Date.today() + timedelta(days=365), + "analytic_account_id": cls.test_account_analytic_account.id, + } + ) + cls.test_agreement_template_no_analytic_account_id = cls.env[ + "agreement" + ].create( + { + "name": "TestAgreementTemplate A", + "description": "Test Template", + "special_terms": "Test Template", + "is_template": True, + "partner_id": cls.test_customer.id, + "start_date": fields.Date.today(), + "end_date": fields.Date.today() + timedelta(days=365), + } + ) + cls.test_product = cls.env["product.product"].create({"name": "TestProduct"}) + cls.test_sale_order = cls.env["sale.order"].create( + { + "partner_id": cls.test_customer.id, + "agreement_template_id": cls.test_agreement_template.id, + "date_order": fields.Date.today(), + "order_line": [ + (0, 0, {"display_type": "line_section", "name": "Test section"}), + (0, 0, {"display_type": "line_note", "name": "Test note"}), + ( + 0, + 0, + {"product_id": cls.test_product.id, "product_uom_qty": 1.0}, + ), + ], + } + ) + cls.test_product_templ_is_serviceprofile = cls.env["product.template"].create( + {"name": "TestProductA", "is_serviceprofile": True} + ) + cls.test_product_is_serviceprofile = cls.env["product.product"].create( + { + "name": "TestProductA", + "is_serviceprofile": True, + "product_tmpl_id": cls.test_product_templ_is_serviceprofile.id, + } + ) + cls.test_sale_order_is_serviceprofile = cls.env["sale.order"].create( + { + "partner_id": cls.test_customer.id, + "agreement_template_id": cls.test_agreement_template.id, + "date_order": fields.Date.today(), + "order_line": [ + (0, 0, {"display_type": "line_section", "name": "Test section"}), + (0, 0, {"display_type": "line_note", "name": "Test note"}), + ( + 0, + 0, + { + "product_id": cls.test_product_is_serviceprofile.id, + "product_uom_qty": 1.0, + }, + ), + ], + } + ) + cls.test_agreement = cls.env["agreement"].create( + { + "name": "TestAgreement A", + "description": "Test Agreement A", + "special_terms": "TestAgreement A", + "start_date": fields.Date.today(), + "end_date": fields.Date.today() + timedelta(days=365), + } + ) + cls.test_sale_order_account_analytic_account = cls.env["sale.order"].create( + { + "partner_id": cls.test_customer.id, + "agreement_template_id": cls.test_agreement_template_no_analytic_account_id.id, + "date_order": fields.Date.today(), + "agreement_id": cls.test_agreement.id, + "order_line": [ + (0, 0, {"product_id": cls.test_product.id, "product_uom_qty": 1.0}) + ], + } + ) + + # TEST 01: Test _action_confirm method + def test_action_confirm(self): + sale_order = self.test_sale_order + sale_order._action_confirm() + agreement = self.env["agreement"].search([("sale_id", "=", sale_order.id)]) + self.assertEqual( + agreement.sale_id.id, + sale_order.id, + ) + + # Test 02: is_serviceprofile Product + is_serviceprofile_so = self.test_sale_order_is_serviceprofile + is_serviceprofile_so._action_confirm() + agreement = self.env["agreement"].search( + [("sale_id", "=", is_serviceprofile_so.id)] + ) + self.assertEqual( + agreement.sale_id.id, + is_serviceprofile_so.id, + ) + # Test 03: Test action_confirm method + self.test_sale_order_account_analytic_account.write( + {"analytic_account_id": self.test_account_analytic_account.id} + ) + self.test_sale_order_account_analytic_account.action_confirm() diff --git a/agreement_legal_sale/views/agreement.xml b/agreement_legal_sale/views/agreement.xml new file mode 100644 index 00000000..8c4be1ef --- /dev/null +++ b/agreement_legal_sale/views/agreement.xml @@ -0,0 +1,31 @@ + + + + + + agreement.form.view + agreement + + + + + + + + + + + + + + + + + + + diff --git a/agreement_legal_sale/views/sale_order.xml b/agreement_legal_sale/views/sale_order.xml new file mode 100644 index 00000000..c6bc21c2 --- /dev/null +++ b/agreement_legal_sale/views/sale_order.xml @@ -0,0 +1,23 @@ + + + + + + sale.order.agreement.form.view + sale.order + + + + + {'invisible': [('agreement_id', '=', False)]} + + + + + + + + diff --git a/setup/agreement_legal_sale/odoo/addons/agreement_legal_sale b/setup/agreement_legal_sale/odoo/addons/agreement_legal_sale new file mode 120000 index 00000000..7c960972 --- /dev/null +++ b/setup/agreement_legal_sale/odoo/addons/agreement_legal_sale @@ -0,0 +1 @@ +../../../../agreement_legal_sale \ No newline at end of file diff --git a/setup/agreement_legal_sale/setup.py b/setup/agreement_legal_sale/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/agreement_legal_sale/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)