diff --git a/agreement/README.rst b/agreement/README.rst new file mode 100644 index 000000000..4ef0a10d0 --- /dev/null +++ b/agreement/README.rst @@ -0,0 +1,93 @@ +========= +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. + +**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 + +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/agreement/__init__.py b/agreement/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/agreement/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/agreement/__manifest__.py b/agreement/__manifest__.py new file mode 100644 index 000000000..96638f92b --- /dev/null +++ b/agreement/__manifest__.py @@ -0,0 +1,27 @@ +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Agreement', + 'summary': "Adds an agreement object", + 'version': '12.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': ['base'], + 'data': [ + 'security/ir.model.access.csv', + 'security/agreement_security.xml', + 'views/agreement.xml', + ], + 'demo': ['demo/demo.xml'], + 'development_status': 'Beta', + 'maintainers': [ + 'ygol', + 'alexis-via', + ], + 'installable': True, +} diff --git a/agreement/demo/demo.xml b/agreement/demo/demo.xml new file mode 100644 index 000000000..5cc580779 --- /dev/null +++ b/agreement/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/agreement/i18n/agreement.pot b/agreement/i18n/agreement.pot new file mode 100644 index 000000000..382458e5f --- /dev/null +++ b/agreement/i18n/agreement.pot @@ -0,0 +1,150 @@ +# 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" +"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 +#: model:ir.model.fields,field_description:agreement.field_agreement__active +msgid "Active" +msgstr "" + +#. module: agreement +#: model:ir.model,name:agreement.model_agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_form +msgid "Agreement" +msgstr "" + +#. module: agreement +#: model:ir.actions.act_window,name:agreement.agreement_action +#: model:ir.ui.menu,name:agreement.agreement_menu +#: model_terms:ir.ui.view,arch_db:agreement.agreement_tree +msgid "Agreements" +msgstr "" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Archived" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__code +msgid "Code" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__company_id +msgid "Company" +msgstr "" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_form +msgid "Configuration" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__create_uid +msgid "Created by" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__create_date +msgid "Created on" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__display_name +msgid "Display Name" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__end_date +msgid "End Date" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__id +msgid "ID" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,help:agreement.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:agreement.field_agreement____last_update +msgid "Last Modified on" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__write_date +msgid "Last Updated on" +msgstr "" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Name or Number" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__partner_id +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Partner" +msgstr "" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Search Agreements" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__signature_date +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Signature Date" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__start_date +msgid "Start Date" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,help:agreement.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:agreement.field_agreement__name +msgid "Title" +msgstr "" + +#. module: agreement +#: model:ir.model.fields,help:agreement.field_agreement__end_date +msgid "When the agreement ends." +msgstr "" + +#. module: agreement +#: model:ir.model.fields,help:agreement.field_agreement__start_date +msgid "When the agreement starts." +msgstr "" + diff --git a/agreement/i18n/fr.po b/agreement/i18n/fr.po new file mode 100644 index 000000000..c5ab124d5 --- /dev/null +++ b/agreement/i18n/fr.po @@ -0,0 +1,132 @@ +# 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-03-30 13:14+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 +#: model:ir.model.fields,field_description:agreement.field_agreement__active +msgid "Active" +msgstr "Actif" + +#. module: agreement +#: model:ir.model,name:agreement.model_agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_form +msgid "Agreement" +msgstr "Accord" + +#. module: agreement +#: model:ir.actions.act_window,name:agreement.agreement_action +#: model:ir.ui.menu,name:agreement.agreement_menu +#: model_terms:ir.ui.view,arch_db:agreement.agreement_tree +msgid "Agreements" +msgstr "Accords" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Archived" +msgstr "Archivé" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__code +msgid "Code" +msgstr "Code" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__company_id +msgid "Company" +msgstr "Entreprise" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_form +msgid "Configuration" +msgstr "Configuration" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__display_name +msgid "Display Name" +msgstr "Nom d'affichage" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__end_date +msgid "End Date" +msgstr "Date de fin" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__id +msgid "ID" +msgstr "ID" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__name +msgid "Name" +msgstr "Nom" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Name or Number" +msgstr "Nom ou Numéro" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__partner_id +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Partner" +msgstr "Partenaire" + +#. module: agreement +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Search Agreements" +msgstr "Recherche Accords" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__signature_date +#: model_terms:ir.ui.view,arch_db:agreement.agreement_search +msgid "Signature Date" +msgstr "Date Signature" + +#. module: agreement +#: model:ir.model.fields,field_description:agreement.field_agreement__start_date +msgid "Start Date" +msgstr "Date Début" + +#. module: agreement +#: sql_constraint:agreement:0 +msgid "This agreement code already exists for this partner!" +msgstr "Code accord existant pour ce partenaire !" diff --git a/agreement/models/__init__.py b/agreement/models/__init__.py new file mode 100644 index 000000000..51f4021fd --- /dev/null +++ b/agreement/models/__init__.py @@ -0,0 +1 @@ +from . import agreement diff --git a/agreement/models/agreement.py b/agreement/models/agreement.py new file mode 100644 index 000000000..dc9755267 --- /dev/null +++ b/agreement/models/agreement.py @@ -0,0 +1,39 @@ +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import models, fields + + +class Agreement(models.Model): + _name = 'agreement' + _description = 'Agreement' + + code = fields.Char(required=True, copy=False) + name = fields.Char(required=True) + partner_id = fields.Many2one( + 'res.partner', string='Partner', ondelete='restrict', required=True, + domain=[('parent_id', '=', False)]) + company_id = fields.Many2one( + 'res.company', string='Company', + default=lambda self: self.env['res.company']._company_default_get( + 'agreement')) + active = fields.Boolean(default=True) + signature_date = fields.Date() + start_date = fields.Date() + end_date = fields.Date() + + def name_get(self): + res = [] + for agr in self: + name = agr.name + if agr.code: + name = u'[%s] %s' % (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/agreement/readme/CONTRIBUTORS.rst b/agreement/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..bc3bbf22d --- /dev/null +++ b/agreement/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Alexis de Lattre +* Yves Goldberg diff --git a/agreement/readme/DESCRIPTION.rst b/agreement/readme/DESCRIPTION.rst new file mode 100644 index 000000000..c58e0465c --- /dev/null +++ b/agreement/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +This module adds an *Agreement* object with the following properties: + +* code, +* name, +* link to a partner, +* signature date. +* start date. +* end date. diff --git a/agreement/security/agreement_security.xml b/agreement/security/agreement_security.xml new file mode 100644 index 000000000..d645ef6d6 --- /dev/null +++ b/agreement/security/agreement_security.xml @@ -0,0 +1,17 @@ + + + + + + + + Agreement multi-company + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + + + diff --git a/agreement/security/ir.model.access.csv b/agreement/security/ir.model.access.csv new file mode 100644 index 000000000..d3d9063c9 --- /dev/null +++ b/agreement/security/ir.model.access.csv @@ -0,0 +1,2 @@ +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 diff --git a/agreement/static/description/icon.png b/agreement/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/agreement/static/description/icon.png differ diff --git a/agreement/static/description/index.html b/agreement/static/description/index.html new file mode 100644 index 000000000..813b88e59 --- /dev/null +++ b/agreement/static/description/index.html @@ -0,0 +1,431 @@ + + + + + + +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.
  • +
+

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/agreement/views/agreement.xml b/agreement/views/agreement.xml new file mode 100644 index 000000000..15f284ce0 --- /dev/null +++ b/agreement/views/agreement.xml @@ -0,0 +1,86 @@ + + + + + + + + agreement.form + agreement + +
+
+ +
+ + + + + + + + + + + + + + + + +
+
+
+ + + agreement.tree + agreement + + + + + + + + + + + + + + + agreement.search + agreement + + + + + + + + + + + + + + + + Agreements + agreement + tree,form + + + + +