Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
A
alterincub_partner
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
AlterIncub
alterincub_partner
Validations
4369c2a5
Valider
4369c2a5
rédigé
27 nov. 2023
par
Benjamin - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[UPD] set type other for provider and incubated
parent
b0322970
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/res_partner.py
+14
-1
14 ajouts, 1 suppression
models/res_partner.py
views/res_partner.xml
+4
-1
4 ajouts, 1 suppression
views/res_partner.xml
avec
18 ajouts
et
2 suppressions
models/res_partner.py
+
14
−
1
Voir le fichier @
4369c2a5
...
@@ -292,6 +292,16 @@ class ResPartner(models.Model):
...
@@ -292,6 +292,16 @@ class ResPartner(models.Model):
# ------------------------------------------------------
# ------------------------------------------------------
# Onchange / Constraints
# Onchange / Constraints
# ------------------------------------------------------
# ------------------------------------------------------
@api.onchange
(
"
is_company
"
)
def
onchange_is_company
(
self
):
"""
Set contact_type to False for person
"""
if
not
self
.
is_company
:
self
.
contact_type
=
False
if
self
.
is_incubated
or
self
.
is_provider
:
self
.
type
=
"
other
"
@api.onchange
(
"
parent_id
"
)
@api.onchange
(
"
parent_id
"
)
def
onchange_parent_id
(
self
):
def
onchange_parent_id
(
self
):
"""
"""
...
@@ -300,7 +310,10 @@ class ResPartner(models.Model):
...
@@ -300,7 +310,10 @@ class ResPartner(models.Model):
result
=
super
().
onchange_parent_id
()
result
=
super
().
onchange_parent_id
()
if
self
.
env
.
context
.
get
(
"
default_parent_id
"
):
if
self
.
env
.
context
.
get
(
"
default_parent_id
"
):
self
.
parent_id
=
self
.
env
.
context
.
get
(
"
default_parent_id
"
)
self
.
parent_id
=
self
.
env
.
context
.
get
(
"
default_parent_id
"
)
if
not
self
.
parent_id
:
self
.
type
=
"
contact
"
else
:
self
.
type
=
"
other
"
return
result
return
result
# ------------------------------------------------------
# ------------------------------------------------------
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
views/res_partner.xml
+
4
−
1
Voir le fichier @
4369c2a5
...
@@ -121,6 +121,9 @@
...
@@ -121,6 +121,9 @@
<xpath
expr=
"//field[@name='parent_id']"
position=
"attributes"
>
<xpath
expr=
"//field[@name='parent_id']"
position=
"attributes"
>
<attribute
name=
"options"
>
{'no_create': 1, 'no_edit': 1}
</attribute>
<attribute
name=
"options"
>
{'no_create': 1, 'no_edit': 1}
</attribute>
<attribute
name=
"domain"
>
parent_id_domain
</attribute>
<attribute
name=
"domain"
>
parent_id_domain
</attribute>
<attribute
name=
"required"
>
context.get('default_is_incubated') or context.get('default_is_provider')
</attribute>
</xpath>
</xpath>
<!-- Type de contact -->
<!-- Type de contact -->
...
@@ -828,7 +831,7 @@
...
@@ -828,7 +831,7 @@
>
[('is_provider', '=', True),('is_company', '!=', True)]
</field>
>
[('is_provider', '=', True),('is_company', '!=', True)]
</field>
<field
<field
name=
"context"
name=
"context"
>
{'default_is_company': False, 'default_is_provider': True}
</field>
>
{'default_is_company': False, 'default_is_provider': True
,
}
</field>
</record>
</record>
</data>
</data>
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Rémi - Le Filament
@remi-filament
mentioned in issue
#2 (closed)
·
27 nov. 2023
mentioned in issue
#2 (closed)
mentioned in issue #2
Afficher/masquer la liste des validations
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