Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
E
Etic 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
ETIC Emballages
Etic Partner
Validations
3b4caa31
Valider
3b4caa31
rédigé
14 avr. 2021
par
jordan
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[add] fields for "commerce"
parent
bb98761a
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
+7
-4
7 ajouts, 4 suppressions
models/res_partner.py
views/res_partner.xml
+47
-7
47 ajouts, 7 suppressions
views/res_partner.xml
avec
54 ajouts
et
11 suppressions
models/res_partner.py
+
7
−
4
Voir le fichier @
3b4caa31
...
...
@@ -27,6 +27,10 @@ class ModelName(models.Model):
business_name
=
fields
.
Char
(
string
=
'
Raison Sociale
'
,
required
=
False
)
region_id
=
fields
.
Many2one
(
comodel_name
=
'
res.country.state
'
,
string
=
'
Région
'
,
required
=
False
)
facebook
=
fields
.
Char
(
string
=
'
Facebook
'
,
...
...
@@ -56,6 +60,9 @@ class ModelName(models.Model):
comodel_name
=
'
res.partner.commerce.status
'
,
string
=
'
Statut du commerce
'
,
required
=
False
)
related_commerce_status
=
fields
.
Many2one
(
string
=
'
Statut du commerce affiché
'
,
related
=
'
commerce_status_id
'
)
gt_commerce_participation
=
fields
.
Boolean
(
string
=
'
Participe au GT Commerce
'
,
required
=
False
)
...
...
@@ -153,10 +160,6 @@ class ModelName(models.Model):
# ------------------------------------------------------
# Onchange / Constraints
# ------------------------------------------------------
@api.onchange
(
'
company_type
'
)
def
onchange_company_type
(
self
):
self
.
type_id
=
None
@api.onchange
(
'
type_id
'
)
def
onchange_type
(
self
):
self
.
subtype_id
=
None
Ce diff est replié.
Cliquez pour l'agrandir.
views/res_partner.xml
+
47
−
7
Voir le fichier @
3b4caa31
...
...
@@ -4,13 +4,22 @@
<odoo>
<data>
<record
id=
"
ModelName
_form_inherit"
model=
"ir.ui.view"
>
<record
id=
"
res_partner
_form_inherit"
model=
"ir.ui.view"
>
<field
name=
"name"
>
res.partner.form
</field>
<field
name=
"model"
>
res.partner
</field>
<field
name=
"inherit_id"
ref=
"base.view_partner_form"
/>
<field
name=
"priority"
eval=
"8"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//sheet"
position=
"before"
>
<header>
<field
name=
"related_commerce_status"
widget=
"statusbar"
clickable=
"0"
attrs=
"{'invisible': [('type_id', 'not in', (%(etic_partner.type_shop)d, %(etic_partner.type_supplier)d))]}"
/>
</header>
</xpath>
<xpath
expr=
"//group[1]"
position=
"before"
>
<group
col=
"2"
>
<group>
<field
name=
"type_id"
options=
"{'no_open': True, 'no_create': True}"
domain=
"[('partner_type', 'in', [company_type, 'all'])]"
/>
...
...
@@ -18,7 +27,38 @@
domain=
"[('parent_type_id', '=', type_id)]"
attrs=
"{'invisible': [('company_type', '=', 'person')]}"
/>
</group>
<group>
<field
name=
"meg"
attrs=
"{'invisible': [('company_type', '=', 'person')]}"
/>
</group>
</group>
</xpath>
<xpath
expr=
"//field[@name='country_id']"
position=
"after"
>
<field
name=
"region_id"
placeholder=
"Région"
class=
"o_address_country"
options=
'{"no_open": True}'
attrs=
"{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"
domain=
"[('country_id', '=', country_id)]"
/>
</xpath>
<xpath
expr=
"//field[@name='function']"
position=
"attributes"
>
<attribute
name=
"string"
>
Fonction
</attribute>
<attribute
name=
"attrs"
>
{'invisible': [('company_type', '!=', 'person')]}
</attribute>
</xpath>
<xpath
expr=
"//field[@name='function']"
position=
"after"
>
<field
name=
"service"
attrs=
"{'invisible': [('company_type', '!=', 'person')]}"
/>
</xpath>
<xpath
expr=
"//page[@name='sales_purchases']"
position=
"after"
>
<page
name=
'commerce'
string=
"Commerce"
attrs=
"{'invisible': [('type_id', 'not in', (%(etic_partner.type_shop)d, %(etic_partner.type_supplier)d))]}"
>
<group>
<field
name=
"commerce_type_id"
options=
"{'no_open': True, 'no_create': True}"
/>
<field
name=
"legal_status_id"
options=
"{'no_open': True, 'no_create': True}"
/>
<field
name=
"commerce_status_id"
options=
"{'no_open': True, 'no_create': True}"
/>
<field
name=
"gt_commerce_participation"
widget=
"boolean_toggle"
/>
</group>
</page>
</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