Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# Copyright 2020 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from datetime import datetime, timedelta
from odoo import models, fields, api
class Project(models.Model):
_inherit = "project.project"
# Champs étape "Demande" => Vue générale
name_subtitle = fields.Char("Sous-titre")
first_contact_id = fields.Many2one(
'res.partner',
string='1er contact',
domain=[
('active', '=', True),
('is_company', '=', False)],
on_delete='restrict')
type_contact = fields.Selection([
('pdp', 'Porteur de projet'),
('adherent', 'Adhérent'),
('no_adherent', 'Non adhérent')],
string="Type contact")
date_first_contact = fields.Date(
"Date de 1er contact")
prescripteur_id = fields.Many2one(
'res.partner',
string='Prescripteur',
domain=[
('active', '=', True),
('is_company', '=', False)],
on_delete='restrict')
prescripteur_company_id = fields.Many2one(
'res.partner',
string='Structure prescripteur',
domain=[
('active', '=', True),
('is_company', '=', True)],
on_delete='restrict')
porteurs_projets_ids = fields.Many2many(
comodel_name='res.partner.porteur.project',
relation='res_partner_porteur_project_rel',
column1='porteur_id',
column2='project_id',
string="Porteurs de projet")
description = fields.Text("Description")
territoire_id = fields.Many2one(
'res.partner',
string='Territoire',
domain=[
('active', '=', True),
('is_company', '=', True),
('type_structure_id', '!=', False)],
on_delete='restrict')
cfd_id = fields.Many2one('res.users', string="CFD")
# Champs étape "Instruction" => Vue générale
od_id = fields.Many2one(
'res.partner',
string='OD',
domain=[
('active', '=', True),
('is_company', '=', True)],
on_delete='restrict')
animateur_id = fields.Many2one(
'res.partner',
string='Animateur',
domain=[
('active', '=', True),
('is_company', '=', False)],
on_delete='restrict')
type_convention_id = fields.Many2one(
'adefpat.type.convention',
string="Type de convention de financement")
date_ca = fields.Date("Date de CA pressenti")
date_start = fields.Date("Date de démarrage prévisionnel")
# list_photos_ids = fields.One2many('images')
# documents_ids = fields.One2many('ir.attachment', "Documents")
# Champs étape "Instruction" => Onglet Dossier
contexte = fields.Text("Contexte projet")
caract_beneficiaire = fields.Text("Caractéristiques du bénéficiaire")
historique = fields.Text("Historique & Aujourd’hui")
besoins_beneficiaires = fields.Text("Besoins des bénéficiaires")
objectifs_accompagnement = fields.Text("Objectifs d’accompagnement / compétences à acquérir (pour le bénéficiaire)")
competences_requises = fields.Text("Compétences requises pour le consultant formateur")
secteurs_requis = fields.Text("Secteurs d’éctivités dont la connaissance est requise pour le consultant formateur")
modalites_intervention = fields.Text("Modalités d'intervention")
modalites_facturation = fields.Text("Modalités de facturation")
modalites_reponse = fields.Text("Modalités de réponse")
# Infos dossier CA
type_beneficiaire = fields.Selection(
[],
string="Type de bénéficiaires")
objectif_projet = fields.Selection(
[],
string="Objectif projet")
secteur_crit = fields.Selection(
[],
string="Secteur d'activité")
taille = fields.Selection(
[],
string="Taille entreprise")
objectif_formation = fields.Selection(
[],
string="Objectif formation")
type_formation = fields.Selection(
[],
string="Type formation")
encadrement = fields.Selection(
[],
string="Encadrement Aides")
lieu = fields.Text("Lieu")
periode_realisation = fields.Text("Période de réalisation")
# duree_totale
# info_budget
# Champs étape "Instruction" => Onglet Consultation
consulant_ids = fields.Many2many(
comodel_name='res.partner.consultants.project',
relation='res_partner_consultants_project_rel',
column1='consultant_id',
column2='project_id',
string="Consultants")
# Champs étape "Instruction" => Onglet GAP
elu_referent_id = fields.Many2one(
'res.partner',
string='Élu référent',
domain=[
('active', '=', True),
('is_company', '=', False)],
on_delete='restrict')
membre_ids = fields.Many2many(
comodel_name='res.partner.membres.project',
relation='res_partner_membres_project_rel',
column1='membre_id',
column2='project_id',
string="Membres")
# documents_gap_ids = fields.One2many('ir.attachment', string="Documents GAP")
modalite_gap = fields.Text("Modalités GAP")
reunion_ids = fields.One2many('adefpat.reunion.gap', 'project_id', string="Réunions")
date_gap = fields.Date("Date du GAP")
# Champs étape "Prêt pour CA" => Onglet Général
num_dossier = fields.Char("Numéro de dossier")
class AdefpatTypeConvention(models.Model):
_name = 'adefpat.type.convention'
_description = 'Liste type de convetion'
name = fields.Char("Convention")
class AdefpatReunionGAP(models.Model):
_name = 'adefpat.reunion.gap'
_description = 'Réunions GAP'
name = fields.Char("Nom de la réunion")
# document_ids = fields.One2many('ir.attachment', string="Documents")
date = fields.Date("Date du GAP")
project_id = fields.Many2one(
'project.project',
string='Projet',
default=lambda self: self.env.context.get('default_project_id'))
class AdefpatMembresProjets(models.Model):
_name = 'res.partner.membres.project'
_description = 'Membres'
name = fields.Char("Nom du membre")
partner_id = fields.Many2one(
'res.partner',
string='Membre',
domain=[
('active', '=', True),
('is_company', '=', False)],
on_delete='restrict')
lastname = fields.Char(
related='partner_id.lastname',
readonly=False)
firstname = fields.Char(
related='partner_id.firstname',
string="Prénom",
readonly=False)
commune = fields.Char(
related='partner_id.city',
string="Commune",
readonly=False)
mobile = fields.Char(
related='partner_id.mobile',
string="Mobile",
readonly=False)
fixe = fields.Char(
related='partner_id.phone',
string="Fixe",
readonly=False)
email = fields.Char(
related='partner_id.email',
string="Email",
readonly=False)
class AdefpatConsultantsProjets(models.Model):
_name = 'res.partner.consultants.project'
_description = 'Consultants'
name = fields.Char("Nom du consultant")
partner_id = fields.Many2one(
'res.partner',
string='Consultant',
domain=[
('active', '=', True),
('is_company', '=', False)],
on_delete='restrict')
lastname = fields.Char(
related='partner_id.lastname',
string="Nom")
firstname = fields.Char(
related='partner_id.firstname',
string="Prénom")
commune = fields.Char(
related='partner_id.city',
string="Commune")
mobile = fields.Char(
related='partner_id.mobile',
string="Mobile")
fixe = fields.Char(
related='partner_id.phone',
string="Fixe")
email = fields.Char(
related='partner_id.email',
string="Email")
reference = fields.Selection([
('reference', 'Référencé'),
('prereference', 'Pré-Référencé'),
('dereference', 'Dé-Référencé')],
related='partner_id.reference',
string="Référencement")
date_cdc = fields.Date("Date d'envoi du CDC")
# cout_journée = fields.Monetary("Coût journée")
# document_ids = fields.One2many('ir.attachment', string="Documents Consultants")
date_selection = fields.Date("Date de sélection")
date_notification = fields.Date("Date de notification")
class AdefpatPorteursProjets(models.Model):
_name = 'res.partner.porteur.project'
_description = 'Porteurs de projets'
name = fields.Char("Nom du porteurs")
partner_id = fields.Many2one(
'res.partner',
string='Porteur de projet',
domain=[
('active', '=', True),
('is_company', '=', False)],
on_delete='restrict')
lastname = fields.Char(
related='partner_id.lastname',
string="Nom")
firstname = fields.Char(
related='partner_id.firstname',
string="Prénom")
commune = fields.Char(
related='partner_id.city',
string="Commune")
mobile = fields.Char(
related='partner_id.mobile',
string="Mobile")
fixe = fields.Char(
related='partner_id.phone',
string="Fixe")
email = fields.Char(
related='partner_id.email',
string="Email")
statut = fields.Selection(
[],
string="Statut")
eligible = fields.Boolean(
string="Eligible")