diff --git a/base_contract/README.rst b/base_contract/README.rst new file mode 100644 index 0000000000..7c8c928f72 --- /dev/null +++ b/base_contract/README.rst @@ -0,0 +1,100 @@ +========= +Agreement +========= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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 + :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 + :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| + +This module adds an *Agreement* object with the following properties: + +* code, +* name, +* link to a partner, +* signature date. +* start date. +* end date. + +Optionally, you can also enable using: +* agreement types +* a flag to set an agreement as a template agreement + +(Install agreement_sale to get the configuration settings for these). + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* Akretion +* Yves Goldberg (Ygol Internetwork) + +Contributors +~~~~~~~~~~~~ + +* Alexis de Lattre +* Yves Goldberg +* Alexandre Fayolle + +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-ygol| image:: https://github.com/ygol.png?size=40px + :target: https://github.com/ygol + :alt: ygol +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via + +Current `maintainers `__: + +|maintainer-ygol| |maintainer-alexis-via| + +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/base_contract/__init__.py b/base_contract/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/base_contract/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/base_contract/__manifest__.py b/base_contract/__manifest__.py new file mode 100644 index 0000000000..6e8d386e4d --- /dev/null +++ b/base_contract/__manifest__.py @@ -0,0 +1,25 @@ +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Base Contract", + "summary": "Adds an contract object", + "version": "13.0.1.0.0", + "category": "Contract", + "author": "Akretion, " + "Yves Goldberg (Ygol Internetwork), " + "Odoo Community Association (OCA)", + "website": "https://github.com/oca/contract", + "license": "AGPL-3", + "depends": ["mail"], + "data": [ + "security/ir.model.access.csv", + "security/agreement_security.xml", + "views/agreement.xml", + "views/agreement_type.xml", + ], + "demo": ["demo/demo.xml"], + "development_status": "Beta", + "maintainers": ["ygol", "alexis-via"], + "installable": True, +} diff --git a/base_contract/demo/demo.xml b/base_contract/demo/demo.xml new file mode 100644 index 0000000000..5cc580779e --- /dev/null +++ b/base_contract/demo/demo.xml @@ -0,0 +1,63 @@ + + + + + + + + C2C-IT0042 + Hardware IT + + 2017-09-10 + 2017-09-10 + 2018-09-10 + + + + C2C-IT0043 + Fiber access office Lausanne + + + + + + + + AGR-VETO001 + Vétérinaire + + 2017-08-01 + 2017-08-01 + 2018-08-01 + + + + AGR-TEL001 + Wazo IPBX deployment and maintenance + + 2017-05-05 + 2017-05-05 + 2018-09-10 + + + + BUY-VOIP012 + SIP Phones supply + + + + + + + + BUY-VOIP013 + SIP-ISDN gateways + + 2017-09-02 + + + + diff --git a/base_contract/i18n/fr.po b/base_contract/i18n/fr.po new file mode 100644 index 0000000000..bee4bfcb0b --- /dev/null +++ b/base_contract/i18n/fr.po @@ -0,0 +1,232 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-07-28 11:47+0000\n" +"Last-Translator: jcleonard2018 \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.7.1\n" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__active +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__active +msgid "Active" +msgstr "Actif" + +#. module: agreement +#: model:ir.model,name:base_contract.model_agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_form +msgid "Agreement" +msgstr "Accord" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__agreement_type_id +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_form_view +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_search +#, fuzzy +#| msgid "Agreement" +msgid "Agreement Type" +msgstr "Accord" + +#. module: agreement +#: model:ir.actions.act_window,name:base_contract.agreement_type_action +#: model:ir.model,name:base_contract.model_agreement_type +#: model:ir.ui.menu,name:base_contract.agreement_type_menu +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_list_view +#, fuzzy +#| msgid "Agreements" +msgid "Agreement Types" +msgstr "Accords" + +#. module: agreement +#: model:ir.actions.act_window,name:base_contract.agreement_action +#: model:ir.ui.menu,name:base_contract.agreement_menu +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_tree +msgid "Agreements" +msgstr "Accords" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_search +msgid "Archived" +msgstr "Archivé" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__company_id +msgid "Company" +msgstr "Entreprise" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_form +msgid "Configuration" +msgstr "Configuration" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__create_uid +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__create_date +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__display_name +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__display_name +msgid "Display Name" +msgstr "Nom d'affichage" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__end_date +msgid "End Date" +msgstr "Date de fin" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__id +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__id +msgid "ID" +msgstr "ID" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__code +msgid "ID used for internal contract tracking." +msgstr "Numéro utilisé pour le suivi interne du contrat." + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__active +msgid "" +"If unchecked, it will allow you to hide the agreement without removing it." +msgstr "Si coché, Cela vous permettra de cacher le contrat sans l'enlever." + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__is_template +msgid "Is a Template?" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement____last_update +#: model:ir.model.fields,field_description:base_contract.field_agreement_type____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__write_uid +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__write_date +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__name +msgid "Name" +msgstr "Nom" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Name or Number" +msgstr "Nom ou Numéro" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__partner_id +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Partner" +msgstr "Partenaire" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__code +msgid "Reference" +msgstr "Référence" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Search Agreements" +msgstr "Recherche Accords" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__agreement_type_id +msgid "Select the type of agreement" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__is_template +msgid "" +"Set if the agreement is a template. Template agreements don't require a " +"partner." +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__signature_date +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Signature Date" +msgstr "Date Signature" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__start_date +msgid "Start Date" +msgstr "Date Début" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__partner_id +msgid "The customer or vendor this agreement is related to." +msgstr "Client ou fournisseur avec lequel le contrat est lié." + +#. module: agreement +#: sql_constraint:agreement:0 +msgid "This agreement code already exists for this partner!" +msgstr "Code accord existant pour ce partenaire !" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__name +msgid "Title" +msgstr "Titre" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_list_view +#, fuzzy +#| msgid "Name" +msgid "Type Name" +msgstr "Nom" + +#. module: agreement +#: model:res.groups,name:base_contract.group_use_agreement_template +#, fuzzy +#| msgid "When the agreement starts." +msgid "Use agreement template" +msgstr "Quand le contrat débute." + +#. module: agreement +#: model:res.groups,name:base_contract.group_use_agreement_type +#, fuzzy +#| msgid "When the agreement ends." +msgid "Use agreement type" +msgstr "Quand le contrat finit." + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__end_date +msgid "When the agreement ends." +msgstr "Quand le contrat finit." + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__start_date +msgid "When the agreement starts." +msgstr "Quand le contrat débute." + +#~ msgid "Code" +#~ msgstr "Code" diff --git a/base_contract/i18n/pt_PT.po b/base_contract/i18n/pt_PT.po new file mode 100644 index 0000000000..62825fef7b --- /dev/null +++ b/base_contract/i18n/pt_PT.po @@ -0,0 +1,227 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-05-04 21:02+0000\n" +"Last-Translator: JC \n" +"Language-Team: none\n" +"Language: pt_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.5.1\n" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__active +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__active +msgid "Active" +msgstr "Activo" + +#. module: agreement +#: model:ir.model,name:base_contract.model_agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_form +msgid "Agreement" +msgstr "Contrato" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__agreement_type_id +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_form_view +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_search +#, fuzzy +#| msgid "Agreement" +msgid "Agreement Type" +msgstr "Contrato" + +#. module: agreement +#: model:ir.actions.act_window,name:base_contract.agreement_type_action +#: model:ir.model,name:base_contract.model_agreement_type +#: model:ir.ui.menu,name:base_contract.agreement_type_menu +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_list_view +#, fuzzy +#| msgid "Agreements" +msgid "Agreement Types" +msgstr "Contratos" + +#. module: agreement +#: model:ir.actions.act_window,name:base_contract.agreement_action +#: model:ir.ui.menu,name:base_contract.agreement_menu +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_tree +msgid "Agreements" +msgstr "Contratos" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_search +msgid "Archived" +msgstr "Arquivado" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__company_id +msgid "Company" +msgstr "Empresa" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_form +msgid "Configuration" +msgstr "Configuração" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__create_uid +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__create_uid +msgid "Created by" +msgstr "Criado por" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__create_date +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__create_date +msgid "Created on" +msgstr "Criado em" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__display_name +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__display_name +msgid "Display Name" +msgstr "Nome" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__end_date +msgid "End Date" +msgstr "Fim de Contrato" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__id +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__id +msgid "ID" +msgstr "Código" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__code +msgid "ID used for internal contract tracking." +msgstr "Código usado internamente para acompanhamento do contrato." + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__active +msgid "" +"If unchecked, it will allow you to hide the agreement without removing it." +msgstr "Desmarcar se quiser esconder o contrato mas sem o apagar." + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__is_template +msgid "Is a Template?" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement____last_update +#: model:ir.model.fields,field_description:base_contract.field_agreement_type____last_update +msgid "Last Modified on" +msgstr "Modificado em" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__write_uid +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__write_uid +msgid "Last Updated by" +msgstr "Actualizado por" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__write_date +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__write_date +msgid "Last Updated on" +msgstr "Actualizado em" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__name +msgid "Name" +msgstr "" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Name or Number" +msgstr "Nome ou número" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__partner_id +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Partner" +msgstr "Parceiro" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__code +msgid "Reference" +msgstr "Referência" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Search Agreements" +msgstr "Pesquisar Contratos" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__agreement_type_id +msgid "Select the type of agreement" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__is_template +msgid "" +"Set if the agreement is a template. Template agreements don't require a " +"partner." +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__signature_date +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Signature Date" +msgstr "Data da assinatura" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__start_date +msgid "Start Date" +msgstr "Data Inicial" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__partner_id +msgid "The customer or vendor this agreement is related to." +msgstr "O cliente ou fornecedor com o qual este contrato está relacionado." + +#. module: agreement +#: sql_constraint:agreement:0 +msgid "This agreement code already exists for this partner!" +msgstr "Este código de contrato já existe para este parceiro!" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__name +msgid "Title" +msgstr "Título" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_list_view +msgid "Type Name" +msgstr "" + +#. module: agreement +#: model:res.groups,name:base_contract.group_use_agreement_template +#, fuzzy +#| msgid "When the agreement starts." +msgid "Use agreement template" +msgstr "A data em que se inicia o contrato." + +#. module: agreement +#: model:res.groups,name:base_contract.group_use_agreement_type +#, fuzzy +#| msgid "When the agreement ends." +msgid "Use agreement type" +msgstr "A data em que termina o contrato." + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__end_date +msgid "When the agreement ends." +msgstr "A data em que termina o contrato." + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__start_date +msgid "When the agreement starts." +msgstr "A data em que se inicia o contrato." diff --git a/base_contract/i18n/zh_CN.po b/base_contract/i18n/zh_CN.po new file mode 100644 index 0000000000..2a7a7cf509 --- /dev/null +++ b/base_contract/i18n/zh_CN.po @@ -0,0 +1,227 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement +# +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 +#: model:ir.model.fields,field_description:base_contract.field_agreement__active +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__active +msgid "Active" +msgstr "有效" + +#. module: agreement +#: model:ir.model,name:base_contract.model_agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_form +msgid "Agreement" +msgstr "协议" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__agreement_type_id +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_form_view +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_search +#, fuzzy +#| msgid "Agreement" +msgid "Agreement Type" +msgstr "协议" + +#. module: agreement +#: model:ir.actions.act_window,name:base_contract.agreement_type_action +#: model:ir.model,name:base_contract.model_agreement_type +#: model:ir.ui.menu,name:base_contract.agreement_type_menu +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_list_view +#, fuzzy +#| msgid "Agreements" +msgid "Agreement Types" +msgstr "协议" + +#. module: agreement +#: model:ir.actions.act_window,name:base_contract.agreement_action +#: model:ir.ui.menu,name:base_contract.agreement_menu +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_tree +msgid "Agreements" +msgstr "协议" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_search +msgid "Archived" +msgstr "已归档" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__company_id +msgid "Company" +msgstr "公司" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_form +msgid "Configuration" +msgstr "配置" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__create_uid +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__create_uid +msgid "Created by" +msgstr "创建者" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__create_date +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__create_date +msgid "Created on" +msgstr "创建时间" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__display_name +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__display_name +msgid "Display Name" +msgstr "显示名称" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__end_date +msgid "End Date" +msgstr "结束日期" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__id +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__id +msgid "ID" +msgstr "ID" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__code +msgid "ID used for internal contract tracking." +msgstr "用于内部合同跟踪的ID。" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__active +msgid "" +"If unchecked, it will allow you to hide the agreement without removing it." +msgstr "如果不选中,它将允许您隐藏协议而不删除它。" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__is_template +msgid "Is a Template?" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement____last_update +#: model:ir.model.fields,field_description:base_contract.field_agreement_type____last_update +msgid "Last Modified on" +msgstr "最后修改时间" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__write_uid +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__write_uid +msgid "Last Updated by" +msgstr "最后更新者" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__write_date +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__write_date +msgid "Last Updated on" +msgstr "最后更新时间" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement_type__name +msgid "Name" +msgstr "" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Name or Number" +msgstr "姓名或号码" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__partner_id +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Partner" +msgstr "业务伙伴" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__code +msgid "Reference" +msgstr "参考" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Search Agreements" +msgstr "搜索协议" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__agreement_type_id +msgid "Select the type of agreement" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__is_template +msgid "" +"Set if the agreement is a template. Template agreements don't require a " +"partner." +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__signature_date +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_search +msgid "Signature Date" +msgstr "签名日期" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__start_date +msgid "Start Date" +msgstr "开始日期" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__partner_id +msgid "The customer or vendor this agreement is related to." +msgstr "与本协议相关的客户或供应商。" + +#. module: agreement +#: sql_constraint:agreement:0 +msgid "This agreement code already exists for this partner!" +msgstr "此合作伙伴的协议代码已存在!" + +#. module: agreement +#: model:ir.model.fields,field_description:base_contract.field_agreement__name +msgid "Title" +msgstr "标题" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:base_contract.agreement_type_list_view +msgid "Type Name" +msgstr "" + +#. module: agreement +#: model:res.groups,name:base_contract.group_use_agreement_template +#, fuzzy +#| msgid "When the agreement starts." +msgid "Use agreement template" +msgstr "协议开始时。" + +#. module: agreement +#: model:res.groups,name:base_contract.group_use_agreement_type +#, fuzzy +#| msgid "When the agreement ends." +msgid "Use agreement type" +msgstr "协议结束时。" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__end_date +msgid "When the agreement ends." +msgstr "协议结束时。" + +#. module: agreement +#: model:ir.model.fields,help:base_contract.field_agreement__start_date +msgid "When the agreement starts." +msgstr "协议开始时。" diff --git a/base_contract/models/__init__.py b/base_contract/models/__init__.py new file mode 100644 index 0000000000..8fc631aa1f --- /dev/null +++ b/base_contract/models/__init__.py @@ -0,0 +1,2 @@ +from . import agreement +from . import agreement_type diff --git a/base_contract/models/agreement.py b/base_contract/models/agreement.py new file mode 100644 index 0000000000..5c3e6ed27d --- /dev/null +++ b/base_contract/models/agreement.py @@ -0,0 +1,67 @@ +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import _, api, fields, models + + +class Agreement(models.Model): + _name = "agreement" + _description = "Agreement" + _inherit = ["mail.thread", "mail.activity.mixin"] + + code = fields.Char(required=True, copy=False) + name = fields.Char(required=True) + partner_id = fields.Many2one( + "res.partner", + string="Partner", + ondelete="restrict", + tracking=True, + domain=[("parent_id", "=", False)], + ) + company_id = fields.Many2one( + "res.company", string="Company", default=lambda self: self.env.company + ) + is_template = fields.Boolean( + string="Is a Template?", + default=False, + copy=False, + help="Set if the agreement is a template. " + "Template agreements don't require a partner.", + ) + agreement_type_id = fields.Many2one( + "agreement.type", string="Agreement Type", help="Select the type of agreement" + ) + domain = fields.Selection( + "_domain_selection", string="Domain", default="sale", tracking=True + ) + active = fields.Boolean(default=True) + signature_date = fields.Date() + start_date = fields.Date() + end_date = fields.Date() + + @api.model + def _domain_selection(self): + return [("sale", _("Sale")), ("purchase", _("Purchase"))] + + @api.onchange("agreement_type_id") + def agreement_type_change(self): + if self.agreement_type_id and self.agreement_type_id.domain: + self.domain = self.agreement_type_id.domain + + def name_get(self): + res = [] + for agr in self: + name = agr.name + if agr.code: + name = "[{}] {}".format(agr.code, agr.name) + res.append((agr.id, name)) + return res + + _sql_constraints = [ + ( + "code_partner_company_unique", + "unique(code, partner_id, company_id)", + "This agreement code already exists for this partner!", + ) + ] diff --git a/base_contract/models/agreement_type.py b/base_contract/models/agreement_type.py new file mode 100644 index 0000000000..2508ac8cf7 --- /dev/null +++ b/base_contract/models/agreement_type.py @@ -0,0 +1,17 @@ +# Copyright (C) 2018 - TODAY, Pavlov Media +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class AgreementType(models.Model): + _name = "agreement.type" + _description = "Agreement Types" + + name = fields.Char(string="Name", required=True) + active = fields.Boolean(default=True) + domain = fields.Selection("_domain_selection", string="Domain", default="sale") + + @api.model + def _domain_selection(self): + return self.env["agreement"]._domain_selection() diff --git a/base_contract/readme/CONTRIBUTORS.rst b/base_contract/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..05342b3317 --- /dev/null +++ b/base_contract/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Alexis de Lattre +* Yves Goldberg +* Alexandre Fayolle diff --git a/base_contract/readme/DESCRIPTION.rst b/base_contract/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..24b6ee5a86 --- /dev/null +++ b/base_contract/readme/DESCRIPTION.rst @@ -0,0 +1,14 @@ +This module adds an *Agreement* object with the following properties: + +* code, +* name, +* link to a partner, +* signature date. +* start date. +* end date. + +Optionally, you can also enable using: +* agreement types +* a flag to set an agreement as a template agreement + +(Install agreement_sale to get the configuration settings for these). diff --git a/base_contract/security/agreement_security.xml b/base_contract/security/agreement_security.xml new file mode 100644 index 0000000000..bac8b3945d --- /dev/null +++ b/base_contract/security/agreement_security.xml @@ -0,0 +1,27 @@ + + + + + + + + Agreement multi-company + + ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] + + + + Use agreement type + + + + + Use agreement template + + + + diff --git a/base_contract/security/ir.model.access.csv b/base_contract/security/ir.model.access.csv new file mode 100644 index 0000000000..9296e5544d --- /dev/null +++ b/base_contract/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_agreement_read,Read access on agreement to Employees,model_agreement,base.group_user,1,0,0,0 +access_agreement_full,Full access on agreement grp,model_agreement,base.group_no_one,1,1,1,1 +access_agreement_type_user,access_agreement_type_user,model_agreement_type,base.group_user,1,0,0,0 +access_agreement_type_manager,access_agreement_type_manager,model_agreement_type,base.group_no_one,1,1,1,1 diff --git a/base_contract/static/description/icon.png b/base_contract/static/description/icon.png new file mode 100644 index 0000000000..a99cce6bee Binary files /dev/null and b/base_contract/static/description/icon.png differ diff --git a/base_contract/static/description/index.html b/base_contract/static/description/index.html new file mode 100644 index 0000000000..6a8f2b62a0 --- /dev/null +++ b/base_contract/static/description/index.html @@ -0,0 +1,436 @@ + + + + + + +Agreement + + + +
+

Agreement

+ + +

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

+

This module adds an Agreement object with the following properties:

+
    +
  • code,
  • +
  • name,
  • +
  • link to a partner,
  • +
  • signature date.
  • +
  • start date.
  • +
  • end date.
  • +
+

Optionally, you can also enable using: +* agreement types +* a flag to set an agreement as a template agreement

+

(Install agreement_sale to get the configuration settings for these).

+

Table of contents

+ +
+

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

+
    +
  • Akretion
  • +
  • Yves Goldberg (Ygol Internetwork)
  • +
+
+
+

Contributors

+ +
+
+

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:

+

ygol alexis-via

+

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/base_contract/views/agreement.xml b/base_contract/views/agreement.xml new file mode 100644 index 0000000000..281532f311 --- /dev/null +++ b/base_contract/views/agreement.xml @@ -0,0 +1,114 @@ + + + + + + + + agreement.form + agreement + +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + agreement.tree + agreement + + + + + + + + + + + + + + + + agreement.search + agreement + + + + + + + + + + + + + + + + + + + + Agreements + agreement + tree,form + + + + + + + +
diff --git a/base_contract/views/agreement_type.xml b/base_contract/views/agreement_type.xml new file mode 100644 index 0000000000..b801260eef --- /dev/null +++ b/base_contract/views/agreement_type.xml @@ -0,0 +1,65 @@ + + + + + Agreement Type List + agreement.type + + + + + + + + + + + Agreement Type Form + agreement.type + +
+
+ +
+ +
+
+ + + +
+
+
+
+ + + agreement.type.search + agreement.type + + + + + + + + + + + + + + + + + + Agreement Types + agreement.type + tree,form + +