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')
|