diff --git a/__manifest__.py b/__manifest__.py index 93fd6ff..d7f3aa4 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -20,15 +20,17 @@ 'version': '0.1', # any module necessary for this one to work correctly - 'depends': ['base'], + 'depends': ['base','mail'], # always loaded 'data': [ - # 'security/ir.model.access.csv', + 'security/ir.model.access.csv', 'views/views.xml', 'views/templates.xml', 'views/calendar.xml', 'views/contactus.xml', + 'views/partner.xml', + 'views/partnerimport.xml', ], # only loaded in demonstration mode 'demo': [ diff --git a/controllers/website_event.py b/controllers/website_event.py index e4c9fbe..f7b4767 100644 --- a/controllers/website_event.py +++ b/controllers/website_event.py @@ -32,3 +32,9 @@ class kalachakra_event(WebsiteEventController): return http.request.render('kalachakra.contactus') + @http.route(['/kalachakra/programme'], type='http', auth='public', website=True, sitemap=False,csrf=False) + def kalachakracontactus(self,**post): + + return http.request.redirect('https://www.dropbox.com/s/ijsd6n82oyp0gw8/programme_Paris.pdf?dl=0') + + diff --git a/models/__init__.py b/models/__init__.py index 5305644..0cbb3f0 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,3 +1,5 @@ # -*- coding: utf-8 -*- -from . import models \ No newline at end of file +from . import models +from . import partnerimport +from . import partner \ No newline at end of file diff --git a/models/partner.py b/models/partner.py new file mode 100644 index 0000000..f9b2a35 --- /dev/null +++ b/models/partner.py @@ -0,0 +1,62 @@ +from odoo import models, fields, api +from odoo.exceptions import UserError, ValidationError, Warning +from psycopg2 import sql, DatabaseError + +from werkzeug import utils + + +class partner(models.Model): + _inherit = 'res.partner' + + statut=fields.Selection([('adherent', 'Adhérent'), ('bienfaiteur', 'Bienfaiteur'),('contact', 'Contact'), ('soutien','Soutien') ],'Statut', required=True, index=True) + date_contact_joomla=fields.Date(string='Date joomla de création du contact', readonly=True) + origine=fields.Selection([ + ('Boutique','Boutique'), + ('Visiteur','Visiteur'), + ('Vincennes','Vincennes'), + ('Bercy','Bercy'), + ('Salon Zen','Salon Zen'), + ('Autre','Autre'), + ('Internet Boutique','Internet Boutique'), + ('Conf M Ricard','Conf M Ricard'), + ('Visite lzr 09','Visite lzr 09'), + ('Retraite','Retraite'), + ('Amis','Amis'), + ('Centre FPMT','Centre FPMT'), + ('Site réservations','Site réservations'), + ('Réservations','Réservations'), + ('Voyage inde','Voyage inde'), + ('Internet','Internet'), + ('Librairie','Librairie'), + ('Site internet boutique','Site internet boutique'), + ('Portes ouvertes st cosme','Portes ouvertes st cosme'), + ('T','T'), + ('maitreya','maitreya'), + ('Zen','Zen'), + ('Lille','Lille'), + ('Alan wallace','Alan wallace'), + ('Salon Rouen','Salon Rouen'), + ('Stage','Stage'), + ('B.Actualit','B.Actualit'), + ('B. Actualit','B. Actualit'), + ('R','R'), + ('Institut vy','Institut vy'), + ('Initiation kalachakr','Initiation kalachakr'), + ('Yoga','Yoga'), + ('Samsara','Samsara'), + ('missun@gmail.com','missun@gmail.com'), + ('Reliques','Reliques'), + ('Journal m','Journal m'), + ('Nantes','Nantes'), + ('retraite vipassana','retraite vipassana'), + ('Presse bouddhiste','Presse bouddhiste'), + ('Réservtions','Réservtions'), + ('Réservation','Réservation'), + ('Site','Site'), + ('Question mail','Question mail'), + ('interreligieux','interreligieux'), + ('Refuge','Refuge'), + ('zoom','zoom'), + ],'Origine', required=True, index=True) + + date_adhesion=fields.Date(string='Date adhesion', readonly=True) \ No newline at end of file diff --git a/models/partnerimport.py b/models/partnerimport.py new file mode 100644 index 0000000..464eac8 --- /dev/null +++ b/models/partnerimport.py @@ -0,0 +1,105 @@ +from odoo import models, fields, api +from odoo.exceptions import UserError, ValidationError +from psycopg2 import sql, DatabaseError +from odoo.tools.safe_eval import safe_eval, datetime + +from werkzeug import utils + + + +class kalachakra_partnerdraft(models.Model): + _name = 'kalachakra.partnerdraft' + _description = 'import draft partner' + + external_id=fields.Char(string='external id') + source=fields.Char(String='source file',required=True) + name=fields.Char(string='name') + firstname=fields.Char(string='firstname') + title=fields.Char(string='civilité') + phone = fields.Char(string='phone') + mobile = fields.Char(string='mobile') + email = fields.Char(string='email') + complement_ident = fields.Char(string='N° appartment,floor') + complement_geo = fields.Char(string='entry,tower,bat') + street = fields.Char(string='street') + street2 = fields.Char(string='street2') + city = fields.Char(string='city') + zip = fields.Char(string='zip code') + country = fields.Char(string='country') + + statut=fields.Selection([('adherent', 'Adhérent'), ('bienfaiteur', 'Bienfaiteur'),('contact', 'Contact'), ('soutien','Soutien') ],'Statut') + date_contact_joomla=fields.Date(string='Date joomla de création du contact') + origine=fields.Selection([ + ('Boutique','Boutique'), + ('Visiteur','Visiteur'), + ('Vincennes','Vincennes'), + ('Bercy','Bercy'), + ('Salon Zen','Salon Zen'), + ('Autre','Autre'), + ('Internet Boutique','Internet Boutique'), + ('Conf M Ricard','Conf M Ricard'), + ('Visite lzr 09','Visite lzr 09'), + ('Retraite','Retraite'), + ('Amis','Amis'), + ('Centre FPMT','Centre FPMT'), + ('Site réservations','Site réservations'), + ('Réservations','Réservations'), + ('Voyage inde','Voyage inde'), + ('Internet','Internet'), + ('Librairie','Librairie'), + ('Site internet boutique','Site internet boutique'), + ('Portes ouvertes st cosme','Portes ouvertes st cosme'), + ('T','T'), + ('maitreya','maitreya'), + ('Zen','Zen'), + ('Lille','Lille'), + ('Alan wallace','Alan wallace'), + ('Salon Rouen','Salon Rouen'), + ('Stage','Stage'), + ('B.Actualit','B.Actualit'), + ('B. Actualit','B. Actualit'), + ('R','R'), + ('Institut vy','Institut vy'), + ('Initiation kalachakr','Initiation kalachakr'), + ('Yoga','Yoga'), + ('Samsara','Samsara'), + ('missun@gmail.com','missun@gmail.com'), + ('Reliques','Reliques'), + ('Journal m','Journal m'), + ('Nantes','Nantes'), + ('retraite vipassana','retraite vipassana'), + ('Presse bouddhiste','Presse bouddhiste'), + ('Réservtions','Réservtions'), + ('Réservation','Réservation'), + ('Site','Site'), + ('Question mail','Question mail'), + ('interreligieux','interreligieux'), + ('Refuge','Refuge'), + ('zoom','zoom')],'Origine', index=True) + + date_adhesion=fields.Date(string='Date adhesion') + doublon=fields.Boolean(string='Doublon') + + def find_duplicated_partner(self): + + + + + + + #affichage des doublons + action = self.env.ref("kalachakra.kalachakra_partnerdraft_action").sudo().read([])[0] + action.update( + { + "domain": [("doublon", "=", True)], + + } + ) + + return action + +class kalachakra_doublonfield(models.Model): + _name = 'kalachakra.doublonfield' + _description = 'doublons fields' + + name=fields.Char('Doublon field name') \ No newline at end of file diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 1219e3c..e8d821d 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,2 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_kalachakra_kalachakra,kalachakra.kalachakra,model_kalachakra_kalachakra,base.group_user,1,1,1,1 \ No newline at end of file +access_kalachakra_partnerdraft,kalachakra_partnerdraft,model_kalachakra_partnerdraft,donation.group_donation_manager,1,1,1,1 +access_kalachakra_doublonsfields,kalachakra_doublonsfields,model_kalachakra_doublonfield,donation.group_donation_manager,1,1,1,1 \ No newline at end of file diff --git a/static/pdf/programme_Paris_2022.pdf b/static/pdf/programme_Paris_2022.pdf new file mode 100644 index 0000000..86601aa Binary files /dev/null and b/static/pdf/programme_Paris_2022.pdf differ diff --git a/views/partner.xml b/views/partner.xml new file mode 100644 index 0000000..085da3e --- /dev/null +++ b/views/partner.xml @@ -0,0 +1,68 @@ + + + + + + kalachakra.res.partner.form + res.partner + + + + + + + + + + + + + + + + + + + + + + + Partners draft + kalachakra.partnerdraft + tree,form + + + + + Doublons fields + kalachakra.doublonfield + tree,form + + + + + find_duplicated_partner + + code + action=model.find_duplicated_partner() + + + + + + + + + + + + + + + + diff --git a/views/partnerimport.xml b/views/partnerimport.xml new file mode 100644 index 0000000..df4fcb6 --- /dev/null +++ b/views/partnerimport.xml @@ -0,0 +1,70 @@ + + + + + _partner_draft list + kalachakra.partnerdraft + + + + + + + + + + + + + + + + + + + + + + + doublons fields list + kalachakra.doublonfield + + + + + + + + + kalachakra_partnerdraft_form + kalachakra.partnerdraft + +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+
+
+ + +
\ No newline at end of file