Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
E
ecozimut_crm
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
Ecozimut
ecozimut_crm
Validations
8aa9a25b
Valider
8aa9a25b
rédigé
6 févr. 2023
par
Rémi - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[UPD] add exclusivity and update views
parent
ac2d2bdb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
models/crm.py
+13
-4
13 ajouts, 4 suppressions
models/crm.py
views/crm_view.xml
+65
-25
65 ajouts, 25 suppressions
views/crm_view.xml
avec
78 ajouts
et
29 suppressions
models/crm.py
+
13
−
4
Voir le fichier @
8aa9a25b
...
...
@@ -26,6 +26,9 @@ class Lead(models.Model):
status_opp
=
fields
.
Selection
(
[(
"
won
"
,
"
Gagné
"
),
(
"
lost
"
,
"
Perdu
"
)],
string
=
"
Statut
"
)
exclusivity
=
fields
.
Selection
(
[(
"
full
"
,
"
Totale
"
),
(
"
partial
"
,
"
Partielle
"
)],
string
=
"
Exclusivité
"
)
def
action_expected_revenue_calc
(
self
):
for
lead
in
self
:
...
...
@@ -55,6 +58,12 @@ class Lead(models.Model):
+
lead
.
mission5
.
pct
)
*
lead
.
initial_amount
def
toggle_active
(
self
):
"""
Overloads function defined in crm with simple toggle of active
"""
to_deactivate
=
self
.
filtered
(
"
active
"
)
to_deactivate
[
"
active
"
]
=
False
(
self
-
to_deactivate
)[
"
active
"
]
=
True
def
action_set_won
(
self
):
res
=
super
(
Lead
,
self
).
action_set_won
()
for
lead
in
self
:
...
...
@@ -62,10 +71,10 @@ class Lead(models.Model):
return
res
def
action_set_lost
(
self
,
**
additional_values
):
res
=
super
(
Lead
,
self
).
action_set_lost
(
**
additional_values
)
for
lead
in
self
:
lead
.
status_opp
=
"
lost
"
return
res
if
additional_values
:
self
.
write
(
dict
(
additional_values
))
self
.
write
({
"
status_opp
"
:
"
lost
"
})
return
True
class
CrmActionType
(
models
.
Model
):
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
views/crm_view.xml
+
65
−
25
Voir le fichier @
8aa9a25b
...
...
@@ -32,31 +32,36 @@
<field
name=
"inherit_id"
ref=
"crm.crm_lead_view_form"
/>
<field
name=
"priority"
>
101
</field>
<field
name=
"arch"
type=
"xml"
>
<button
name=
"action_set_won_rainbowman"
position=
"attributes"
>
<attribute
name=
"attrs"
>
{'invisible': [('status_opp', '=', 'won')]}
</attribute>
</button>
<button
name=
"%(crm.crm_lead_lost_action)d"
position=
"attributes"
>
<attribute
name=
"attrs"
>
{'invisible': [('
active', '=', False),('probability', '
<
', 100
)]}
</attribute>
>
{'invisible': [('
status_opp', '=', 'lost'
)]}
</attribute>
</button>
<button
name=
"toggle_active"
position=
"replace"
/>
<button
name=
"action_set_lost"
position=
"replace"
/>
<xpath
expr=
"//group[@name='opportunity_partner']//field[@name='partner_id']"
position=
"before"
<sheet
position=
"before"
>
<div
class=
"alert"
role=
"alert"
style=
"margin-bottom:0px;color:white;background-color:#000080;border-color:#000066;"
attrs=
"{'invisible': [('exclusivity', '!=', 'full')]}"
>
<field
name=
"status_opp"
invisible=
"1"
/>
</xpath>
<xpath
expr=
"//widget[2]"
position=
"replace"
>
<widget
name=
"web_ribbon"
title=
"Perdu"
bg_color=
"bg-danger"
attrs=
"{'invisible': [('status_opp', '!=', 'lost')]}"
/>
<widget
name=
"web_ribbon"
title=
"Gagné"
attrs=
"{'invisible': [('status_opp', '!=', 'won')]}"
/>
</xpath>
Exclusivité totale
</div>
<div
class=
"alert"
role=
"alert"
style=
"margin-bottom:0px;color:black;background-color:#fd3f92;border-color:#c80259;"
attrs=
"{'invisible': [('exclusivity', '!=', 'partial')]}"
>
Exclusivité partielle
</div>
</sheet>
<header
position=
"inside"
>
<button
name=
"action_expected_revenue_calc"
...
...
@@ -66,11 +71,36 @@
attrs=
"{'invisible': [('type', '=', 'lead')]}"
/>
</header>
<xpath
expr=
"//widget[1]"
position=
"attributes"
>
<attribute
name=
"attrs"
>
{'invisible': [('status_opp', '!=', 'lost')]}
</attribute>
</xpath>
<xpath
expr=
"//widget[2]"
position=
"attributes"
>
<attribute
name=
"attrs"
>
{'invisible': [('status_opp', '!=', 'won')]}
</attribute>
</xpath>
<xpath
expr=
"//group[@name='opportunity_partner']//field[@name='partner_id']"
position=
"before"
>
<field
name=
"status_opp"
groups=
"base.group_no_one"
/>
<field
name=
"lost_reason"
attrs=
"{'invisible': [('status_opp', '!=', 'lost')]}"
/>
</xpath>
<xpath
expr=
"//group[@name='opportunity_info']//field[@name='lost_reason']"
position=
"replace"
/>
<xpath
expr=
"//notebook/page[@name='lead']"
position=
"after"
>
<page
string=
"Détail"
name=
"details"
>
<group
string=
"Projet"
>
<group>
<field
name=
"categorie_type"
required=
"1"
/>
<field
name=
"exclusivity"
/>
<field
name=
"provisional_delivery_date"
attrs=
"{'invisible': [('type', '=', 'lead')]}"
...
...
@@ -152,27 +182,37 @@
</group>
<group
string=
"Acteurs"
attrs=
"{'invisible': [('type', '=', '
lead
')]}"
attrs=
"{'invisible': [('
categorie_
type', '=
=
', '
interne
')]}"
>
<group>
<field
name=
"customer_type"
/>
<field
name=
"customer_type"
attrs=
"{'invisible': ['|', ('type', '=', 'lead'), ('categorie_type', 'not in', ('formation', 'r_d', 'action_commercial'))]}"
/>
<field
name=
"customer_subtype"
options=
"{'no_open': True, 'no_create': True}"
attrs=
"{'invisible': ['|', ('type', '=', 'lead'), ('categorie_type', 'not in', ('formation', 'r_d', 'action_commercial'))]}"
/>
<field
name=
"moa"
attrs=
"{'invisible': [('type', '=', 'lead')]}"
/>
<field
name=
"moa"
/>
<field
name=
"archi_mandataire"
/>
<field
name=
"archi_cotraitant"
/>
<field
name=
"first_time_with_archi"
/>
</group>
<group>
<group
attrs=
"{'invisible': [('type', '=', 'lead')]}"
>
<field
name=
"landscaper"
/>
<field
name=
"be_structure"
/>
<field
name=
"other_moe_members"
/>
</group>
</group>
<group
string=
"Mission"
>
<group
string=
"Missions"
attrs=
"{'invisible': [('categorie_type', '!=', 'bureau_etude')]}"
>
<group>
<field
name=
"mission_type"
/>
<field
name=
"mission_nature"
/>
...
...
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