Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
A
ap_sale_project
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Le Filament
Arbre et Paysage
ap_sale_project
Validations
774c4bea
Valider
774c4bea
rédigé
Il y a 3 ans
par
Rémi - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[ENH] Pre-Commit
parent
1b6a7d8f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
4
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
models/res_partner.py
+6
-3
6 ajouts, 3 suppressions
models/res_partner.py
models/sale_order.py
+5
-4
5 ajouts, 4 suppressions
models/sale_order.py
models/sale_project.py
+2
-5
2 ajouts, 5 suppressions
models/sale_project.py
views/res_partner_views.xml
+23
-7
23 ajouts, 7 suppressions
views/res_partner_views.xml
avec
36 ajouts
et
19 suppressions
models/res_partner.py
+
6
−
3
Voir le fichier @
774c4bea
...
...
@@ -48,11 +48,14 @@ class ResPartner(models.Model):
# ------------------------------------------------------
def
action_view_partner_projects
(
self
):
self
.
ensure_one
()
action
=
self
.
env
[
"
ir.actions.actions
"
].
_for_xml_id
(
"
ap_sale_project.action_sale_project
"
)
action
[
'
domain
'
]
=
[
(
'
partner_id
'
,
'
child_of
'
,
self
.
id
),
action
=
self
.
env
[
"
ir.actions.actions
"
].
_for_xml_id
(
"
ap_sale_project.action_sale_project
"
)
action
[
"
domain
"
]
=
[
(
"
partner_id
"
,
"
child_of
"
,
self
.
id
),
]
return
action
# ------------------------------------------------------
# Business methods
# ------------------------------------------------------
Ce diff est replié.
Cliquez pour l'agrandir.
models/sale_order.py
+
5
−
4
Voir le fichier @
774c4bea
...
...
@@ -30,9 +30,10 @@ class SaleOrder(models.Model):
current_inter
=
list
()
for
project
in
self
.
sale_project_ids
:
for
inter
in
project
.
intervention_ids
:
current_inter
.
append
(
(
project
.
id
,
inter
.
intervention_type_id
.
id
))
current_inter
.
append
((
project
.
id
,
inter
.
intervention_type_id
.
id
))
for
sol
in
self
.
order_line
:
if
sol
.
product_id
and
(
sol
.
sale_project_id
.
id
,
sol
.
product_id
.
id
)
\
not
in
current_inter
:
if
(
sol
.
product_id
and
(
sol
.
sale_project_id
.
id
,
sol
.
product_id
.
id
)
not
in
current_inter
):
sol
.
unlink
()
Ce diff est replié.
Cliquez pour l'agrandir.
models/sale_project.py
+
2
−
5
Voir le fichier @
774c4bea
...
...
@@ -207,7 +207,7 @@ class SaleProject(models.Model):
# ------------------------------------------------------
def
update_order_lines
(
self
):
# group by intervention_type for current project
lines
=
self
.
env
[
'
sale.intervention
'
].
read_group
(
lines
=
self
.
env
[
"
sale.intervention
"
].
read_group
(
((
"
project_id
"
,
"
=
"
,
self
.
id
),),
(
"
price
"
,
"
intervention_length
"
,
"
plant_qty
"
),
"
intervention_type_id
"
,
...
...
@@ -239,10 +239,7 @@ class SaleProject(models.Model):
data
.
update
(
{
"
order_id
"
:
self
.
sale_order_id
.
id
,
"
name
"
:
"
Projet
"
+
self
.
name
+
"
-
"
+
product_tmpl
.
name
,
"
name
"
:
"
Projet
"
+
self
.
name
+
"
-
"
+
product_tmpl
.
name
,
"
product_id
"
:
product_tmpl
.
product_variant_id
.
id
,
"
sale_project_id
"
:
self
.
id
,
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
views/res_partner_views.xml
+
23
−
7
Voir le fichier @
774c4bea
...
...
@@ -8,8 +8,13 @@
<field
name=
"inherit_id"
ref=
"base.view_partner_form"
/>
<field
name=
"arch"
type=
"xml"
>
<div
name=
"button_box"
position=
"inside"
>
<button
type=
"object"
class=
"oe_stat_button"
icon=
"fa-pagelines"
name=
"action_view_partner_projects"
context=
"{'default_partner_id': active_id}"
>
<button
type=
"object"
class=
"oe_stat_button"
icon=
"fa-pagelines"
name=
"action_view_partner_projects"
context=
"{'default_partner_id': active_id}"
>
<div
class=
"o_form_field o_stat_info"
>
<span
class=
"o_stat_value"
>
<field
name=
"sale_project_count"
/>
...
...
@@ -30,8 +35,19 @@
<field
name=
"mobile"
position=
"after"
>
<field
name=
"sale_project_count"
/>
</field>
<xpath
expr=
"//span[hasclass('oe_kanban_partner_links')]"
position=
"inside"
>
<span
t-if=
"record.sale_project_count.value>0"
class=
"badge badge-pill"
><i
class=
"fa fa-pagelines"
role=
"img"
aria-label=
"Projets"
title=
"Projets"
/><t
t-esc=
"record.sale_project_count.value"
/></span>
<xpath
expr=
"//span[hasclass('oe_kanban_partner_links')]"
position=
"inside"
>
<span
t-if=
"record.sale_project_count.value>0"
class=
"badge badge-pill"
><i
class=
"fa fa-pagelines"
role=
"img"
aria-label=
"Projets"
title=
"Projets"
/><t
t-esc=
"record.sale_project_count.value"
/></span>
</xpath>
</field>
</record>
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter