Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
adefpat_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Adefpat
adefpat_project
Compare revisions
e86671b39484fb8f0da8c8945a1045b72e4ac823 to 6aae160c1d6cd2a9ff84fb5c2f7e0d7731ce88ea
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
lefilament/adefpat/adefpat_project
Select target project
No results found
6aae160c1d6cd2a9ff84fb5c2f7e0d7731ce88ea
Select Git revision
Branches
12.0
Swap
Target
lefilament/adefpat/adefpat_project
Select target project
lefilament/adefpat/adefpat_project
1 result
e86671b39484fb8f0da8c8945a1045b72e4ac823
Select Git revision
Branches
12.0
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
[fix] error constrains on PP
· 290a9c4c
Benjamin - Le Filament
authored
2 years ago
290a9c4c
[update] project form view - section Critères CA
· cf52a899
Benjamin - Le Filament
authored
2 years ago
cf52a899
[update] task form view
· 6aae160c
Benjamin - Le Filament
authored
2 years ago
6aae160c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
models/project.py
+5
-4
5 additions, 4 deletions
models/project.py
models/project_task.py
+32
-29
32 additions, 29 deletions
models/project_task.py
views/project_task_views.xml
+22
-20
22 additions, 20 deletions
views/project_task_views.xml
views/project_views.xml
+1
-1
1 addition, 1 deletion
views/project_views.xml
with
60 additions
and
54 deletions
models/project.py
View file @
6aae160c
...
...
@@ -936,10 +936,11 @@ class AdefpatPorteursProjets(models.Model):
# ------------------------------------------------------
@api.constrains
(
"
task_id
"
,
"
project_id
"
)
def
_check_task_or_project
(
self
):
if
not
self
.
task_id
and
not
self
.
project_id
:
raise
ValidationError
(
"
Un porteur de projet doit être associé à une tâche ou un projet.
"
)
for
pp
in
self
:
if
not
pp
.
task_id
and
not
pp
.
project_id
:
raise
ValidationError
(
"
Un porteur de projet doit être associé à une tâche ou un projet.
"
)
@api.depends
(
"
porteur_id
"
)
def
_compute_commune
(
self
):
...
...
This diff is collapsed.
Click to expand it.
models/project_task.py
View file @
6aae160c
...
...
@@ -8,37 +8,36 @@ class ProjectTask(models.Model):
_inherit
=
"
project.task
"
@api.model
def
default_get
(
self
,
fields
):
res
=
super
(
ProjectTask
,
self
).
default_get
(
fields
)
def
_default_formateur_id
(
self
):
if
"
default_project_id
"
in
self
.
env
.
context
:
default_project_id
=
self
.
env
[
"
project.project
"
].
browse
(
cout_id
=
self
.
env
[
"
adefpat.project.cout
"
].
search
(
[
(
"
project_id
"
,
"
=
"
,
self
.
env
.
context
[
"
default_project_id
"
]),
(
"
partner_id
"
,
"
!=
"
,
False
),
],
limit
=
1
,
)
return
cout_id
.
partner_id
.
id
@api.model
def
_default_participant_ids
(
self
):
if
"
default_project_id
"
in
self
.
env
.
context
:
project_id
=
self
.
env
[
"
project.project
"
].
browse
(
self
.
env
.
context
[
"
default_project_id
"
]
)
if
default_project_id
.
exists
().
porteurs_projets_ids
:
participant_ids
=
[]
for
porteur_project
in
default_project_id
.
porteurs_projets_ids
:
vals
=
{
"
porteur_id
"
:
porteur_project
.
porteur_id
.
id
,
"
lastname
"
:
porteur_project
.
lastname
,
"
firstname
"
:
porteur_project
.
firstname
,
"
commune
"
:
porteur_project
.
commune
,
"
mobile
"
:
porteur_project
.
mobile
,
"
fixe
"
:
porteur_project
.
fixe
,
"
email
"
:
porteur_project
.
email
,
"
eligible
"
:
porteur_project
.
eligible
,
}
participant_ids
.
append
((
0
,
0
,
vals
))
res
.
update
({
"
participant_ids
"
:
participant_ids
})
cout_id
=
self
.
env
[
"
adefpat.project.cout
"
].
search
(
[
(
"
project_id
"
,
"
=
"
,
default_project_id
.
id
),
(
"
partner_id
"
,
"
!=
"
,
False
),
],
limit
=
1
,
)
if
cout_id
:
res
.
update
({
"
formateur_id
"
:
cout_id
.
partner_id
.
id
})
return
res
if
project_id
.
exists
().
membre_ids
:
participant_ids
=
project_id
.
porteurs_projets_ids
.
mapped
(
lambda
p
:
(
0
,
0
,
{
"
porteur_id
"
:
p
.
porteur_id
.
id
,
"
lastname
"
:
p
.
lastname
,
"
firstname
"
:
p
.
firstname
,
"
commune
"
:
p
.
commune
,
"
mobile
"
:
p
.
mobile
,
"
fixe
"
:
p
.
fixe
,
"
email
"
:
p
.
email
,
"
eligible
"
:
p
.
eligible
,
}))
self
.
update
({
"
participant_ids
"
:
participant_ids
})
return
participant_ids
user_id
=
fields
.
Many2one
(
"
res.users
"
,
...
...
@@ -59,6 +58,7 @@ class ProjectTask(models.Model):
(
"
reference
"
,
"
=
"
,
"
prereference
"
),
],
ondelete
=
"
restrict
"
,
default
=
_default_formateur_id
,
)
duree_jr
=
fields
.
Selection
(
[
...
...
@@ -69,7 +69,10 @@ class ProjectTask(models.Model):
)
duree_hr
=
fields
.
Float
(
"
Durée (int)
"
,
compute
=
"
_compute_duree_hr
"
,
store
=
True
)
participant_ids
=
fields
.
One2many
(
"
res.partner.porteur.project
"
,
"
task_id
"
,
string
=
"
Participants
"
comodel_name
=
"
res.partner.porteur.project
"
,
inverse_name
=
"
task_id
"
,
string
=
"
Participants
"
,
default
=
_default_participant_ids
,
)
cout_seance
=
fields
.
Float
(
"
Coût de la séance
"
,
compute
=
"
_compute_cout_seance
"
)
date_account
=
fields
.
Date
(
"
Date de la facture
"
)
...
...
This diff is collapsed.
Click to expand it.
views/project_task_views.xml
View file @
6aae160c
...
...
@@ -21,26 +21,28 @@
<field
name=
"inherit_id"
ref=
"project.view_task_form2"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//notebook"
position=
"before"
>
<group>
<field
name=
"participant_ids"
widget=
"one2many"
>
<tree
string=
"Participants"
editable=
"top"
default_order=
'porteur_id'
>
<field
name=
"porteur_id"
/>
<field
name=
"lastname"
/>
<field
name=
"firstname"
/>
<field
name=
"commune"
/>
<field
name=
"mobile"
/>
<field
name=
"fixe"
/>
<field
name=
"email"
widget=
"email"
/>
<field
name=
"h_theoriques"
/>
<field
name=
"h_pratiques"
/>
<field
name=
"eligible"
/>
</tree>
</field>
</group>
<label
for=
"participant_ids"
/>
<field
name=
"participant_ids"
widget=
"one2many"
domain=
"[('project_id', '=', context.get('active_id'))]"
>
<tree
string=
"Participants"
editable=
"top"
default_order=
'porteur_id'
>
<field
name=
"porteur_id"
/>
<field
name=
"lastname"
/>
<field
name=
"firstname"
/>
<field
name=
"commune"
/>
<field
name=
"mobile"
/>
<field
name=
"fixe"
/>
<field
name=
"email"
widget=
"email"
/>
<field
name=
"h_theoriques"
/>
<field
name=
"h_pratiques"
/>
<field
name=
"eligible"
/>
</tree>
</field>
</xpath>
<xpath
expr=
"//field[@name='user_id']"
position=
"after"
>
<field
name=
"formateur_id"
/>
...
...
This diff is collapsed.
Click to expand it.
views/project_views.xml
View file @
6aae160c
...
...
@@ -365,7 +365,7 @@
</div>
<div
class=
"row"
attrs=
"{'invisible': [('type_accompagnement', '
not in
',
(
'interentreprises'
,'territoriaux')
)], 'required': [('type_accompagnement', '
not in
',
(
'interentreprises'
,'territoriaux')
)]}"
attrs=
"{'invisible': [('type_accompagnement', '
!=
', 'interentreprises')], 'required': [('type_accompagnement', '
!=
', 'interentreprises')]}"
>
<div
class=
"col-7 border-right"
>
<label
for=
"nb_entreprises"
style=
"font-weight: bold;"
/>
...
...
This diff is collapsed.
Click to expand it.