commit d0af9f97b268b4e5ddd17fd7a5615dafed7ef8e2 Author: eloyoussef Date: Sun Feb 4 03:41:02 2018 +0100 first commit diff --git a/contact_customized/__init__.py b/contact_customized/__init__.py new file mode 100755 index 0000000..bff786c --- /dev/null +++ b/contact_customized/__init__.py @@ -0,0 +1 @@ +import models diff --git a/contact_customized/__manifest__.py b/contact_customized/__manifest__.py new file mode 100755 index 0000000..837f1c4 --- /dev/null +++ b/contact_customized/__manifest__.py @@ -0,0 +1,19 @@ +{ + 'name':'Customized Contact', + 'version': '1.0', + 'author': 'Youssef ELOUAHBY', + 'website': 'http://www.test.ye', + 'sequence': 2, + 'category': 'Tools', + 'summary': 'Customers, Vendors, Partners,...', + 'description': """ + This module allows customization of contacts + """, + 'depends': ['base','contacts'], + 'data': ['views/contact.xml', + 'views/type.xml' + ], + 'installable': True, + 'application': True, + 'auto_install': False, +} diff --git a/contact_customized/i18n/fr.po b/contact_customized/i18n/fr.po new file mode 100755 index 0000000..1fca23b --- /dev/null +++ b/contact_customized/i18n/fr.po @@ -0,0 +1,123 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contact_customized +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-13 17:58+0000\n" +"PO-Revision-Date: 2018-01-13 17:58+0000\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: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type_Actif +msgid "Active" +msgstr "Actif" + +#. module: contact_customized +#: model:ir.ui.view,arch_db:contact_customized.view_contact_calendar +msgid "Calendar" +msgstr "Calendrier" + +#. module: contact_customized +#: model:ir.ui.menu,name:contact_customized.configuration_type_contact +msgid "Configuration" +msgstr "Configuration" + +#. module: contact_customized +#: model:ir.actions.act_window,name:contact_customized.contact_type_action +#: model:ir.ui.menu,name:contact_customized.typecontact_menu +msgid "Contact Type" +msgstr "Contact Type" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_res_partner_type_id +#: model:ir.model.fields,field_description:contact_customized.field_res_users_type_id +msgid "Contact type" +msgstr "Type de contact" + +#. module: contact_customized +#: model:ir.ui.view,arch_db:contact_customized.view_contact_pivot +msgid "Contacts" +msgstr "Contacts" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type_create_date +msgid "Created on" +msgstr "Créé le" + + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_res_partner_dateOfFirstContact +#: model:ir.model.fields,field_description:contact_customized.field_res_users_dateOfFirstContact +msgid "Date of first contact" +msgstr "Date du 1er contact" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type_display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_res_partner_fullAddress +#: model:ir.model.fields,field_description:contact_customized.field_res_users_fullAddress +msgid "Full address" +msgstr "Adresse complète" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type_id +msgid "ID" +msgstr "ID" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_res_partner_isVip +#: model:ir.model.fields,field_description:contact_customized.field_res_users_isVip +msgid "Is VIP" +msgstr "Contact privilégié" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type___last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type_write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: contact_customized +#: model:ir.model,name:contact_customized.model_res_partner +msgid "Partner" +msgstr "Partenaire" + +#. module: contact_customized +#: model:ir.model.fields,field_description:contact_customized.field_contact_type_name +msgid "Type" +msgstr "Type" + +#. module: contact_customized +#: sql_constraint:contact.type:0 +msgid "Type must be unique!" +msgstr "Type must be unique!" + +#. module: contact_customized +#: model:ir.ui.view,arch_db:contact_customized.view_partner_search_persocontact_inherited +msgid "VIP" +msgstr "VIP" + diff --git a/contact_customized/models/__init__.py b/contact_customized/models/__init__.py new file mode 100755 index 0000000..94f0878 --- /dev/null +++ b/contact_customized/models/__init__.py @@ -0,0 +1,3 @@ +import type + + diff --git a/contact_customized/models/__init__.pyc b/contact_customized/models/__init__.pyc new file mode 100755 index 0000000..ebfecd8 Binary files /dev/null and b/contact_customized/models/__init__.pyc differ diff --git a/contact_customized/models/type.py b/contact_customized/models/type.py new file mode 100755 index 0000000..5783f47 --- /dev/null +++ b/contact_customized/models/type.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, _ +from datetime import datetime +from odoo.exceptions import Warning + + +#class contact.type qui permet de stocker le type du contact et s'il est actif +class contactType(models.Model): + _name = 'contact.type' + + + _description ="Daily Transaction" + + name = fields.Char(string='Type', size=128, required=True, translate=True) + Actif=fields.Boolean('Active', default=True, translate=True) + + _sql_constraints = [ + ('name', 'unique(name)', + 'Type must be unique!'), + ] + +#class heristé du class res.partner pour l'ajout des nouveaux champs au contact +class contactPerso(models.Model): + _inherit = "res.partner" + _order="dateOfFirstContact desc" + + fullAddress = fields.Char(string="Full address",size =300, compute="get_adress", translate=True) + isVip = fields.Boolean(string="Is VIP",default=False, translate=True) + dateOfFirstContact = fields.Date(string="Date of first contact", default=fields.Date.today, translate=True) + type_id= fields.Many2one('contact.type', string="Contact type", required=True, translate=True) + + #Calcul champs Addresse complete + + @api.one + @api.depends('street','street2','city','zip') + def get_adress(self): + fullAddress =" " + if self.street : + fullAddress += self.street +' ' + if self.street2: + fullAddress += self.street2+' ' + if self.city: + fullAddress += self.city +' ' + if self.zip: + fullAddress += self.zip + self.fullAddress = fullAddress + + #Validation de la date pour empecher qu'elle soit apres la date courante + + @api.constrains('dateOfFirstContact') + def constFirstContact(self): + current_date = datetime.now().date() + dateOfFirstContact = fields.Datetime.from_string(self.dateOfFirstContact).date() + if dateOfFirstContact > current_date: + raise Warning('Invalid Date!') diff --git a/contact_customized/models/type.pyc b/contact_customized/models/type.pyc new file mode 100755 index 0000000..9005818 Binary files /dev/null and b/contact_customized/models/type.pyc differ diff --git a/contact_customized/views/contact.xml b/contact_customized/views/contact.xml new file mode 100755 index 0000000..47986b3 --- /dev/null +++ b/contact_customized/views/contact.xml @@ -0,0 +1,101 @@ + + + + + + + base.view_partner_form.perso.inherited + res.partner + + + + + + + + + + + + + + base.tree.perso.inherited + res.partner + + + + + + + + + + + + base.srch.perso.inherited + res.partner + + + + + + + + + + + + + + base.kanban.perso.inherited + res.partner + + + + + + + +
  • ,
  • +
  • + +
    + +
    +
    + + + + partner.calendar + res.partner + + + + + + + + + + + partner.pivot + res.partner + + + + + + + + + + + kanban,tree,calendar,pivot,graph,form + + + +
    +
    diff --git a/contact_customized/views/type.xml b/contact_customized/views/type.xml new file mode 100755 index 0000000..5546e4f --- /dev/null +++ b/contact_customized/views/type.xml @@ -0,0 +1,46 @@ + + + + + + + contact search + contact.type + + + + + + + + + + + contact tree + contact.type + + + + + + + + + + + Contact Type + contact.type + form + tree,form + + + + + + + + + + diff --git a/sample_addon/__init__.py b/sample_addon/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sample_addon/__manifest__.py b/sample_addon/__manifest__.py new file mode 100644 index 0000000..c363b54 --- /dev/null +++ b/sample_addon/__manifest__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017 Firstname Lastname +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +{ + 'name': 'Sample module', + 'summary': 'Sample module that does nothing', + 'description': """ Sample module that does nothing """, + 'version': '10.0.0.0.1', + 'category': 'Useless', + 'author': 'Firstname Lastname', + 'license': 'AGPL-3', + 'application': False, + 'installable': True, + 'depends': ['base'] +}