Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
M
mucs_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
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
Mutuelle des Scop et des Scic
mucs_partner
Validations
7c89d4ec
Valider
7c89d4ec
rédigé
Il y a 2 mois
par
Hugo Trentesaux
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
wip
parent
b58b5b39
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
__manifest__.py
+2
-1
2 ajouts, 1 suppression
__manifest__.py
models/res_partner.py
+31
-1
31 ajouts, 1 suppression
models/res_partner.py
views/res_partner.xml
+29
-10
29 ajouts, 10 suppressions
views/res_partner.xml
avec
62 ajouts
et
12 suppressions
__manifest__.py
+
2
−
1
Voir le fichier @
7c89d4ec
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
"
website
"
:
"
https://le-filament.com
"
,
"
website
"
:
"
https://le-filament.com
"
,
"
version
"
:
"
18.0.1.0.0
"
,
"
version
"
:
"
18.0.1.0.0
"
,
"
license
"
:
"
AGPL-3
"
,
"
license
"
:
"
AGPL-3
"
,
"
depends
"
:
[],
"
depends
"
:
[
"
l10n_fr_state
"
,
"
l10n_fr_department
"
,
"
l10n_fr_department_oversea
"
],
"
data
"
:
[
"
data
"
:
[
"
security/ir.model.access.csv
"
,
"
security/ir.model.access.csv
"
,
# datas
# datas
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
models/res_partner.py
+
31
−
1
Voir le fichier @
7c89d4ec
...
@@ -8,12 +8,36 @@ from odoo.exceptions import ValidationError
...
@@ -8,12 +8,36 @@ from odoo.exceptions import ValidationError
class
ResPartner
(
models
.
Model
):
class
ResPartner
(
models
.
Model
):
_inherit
=
"
res.partner
"
_inherit
=
"
res.partner
"
# ------------------------------------------------------
# ------------------------------------------------------
# Fields declaration
# Fields declaration
# ------------------------------------------------------
# ------------------------------------------------------
is_cooperative
=
fields
.
Boolean
(
"
Est une coopérative
"
)
is_cooperative
=
fields
.
Boolean
(
"
Est une coopérative
"
)
is_member_cgscop
=
fields
.
Boolean
(
"
Est adhérent à la CG SCOP
"
)
size_group
=
fields
.
Selection
(
[(
"
1-5
"
,
"
1 à 5
"
),
(
"
5-15
"
,
"
5 à 15
"
),
(
"
15-50
"
,
"
15 à 50
"
),
(
"
50-100
"
,
"
50 à 100
"
),
(
"
+100
"
,
"
plus de 100
"
)],
string
=
"
Tranche d
'
effectif
"
)
siret
=
fields
.
Char
(
index
=
True
,
tracking
=
True
,
copy
=
False
)
siren
=
fields
.
Char
(
string
=
"
SIREN
"
,
compute
=
"
_compute_siren
"
,
store
=
True
,
readonly
=
False
,
copy
=
False
,
tracking
=
True
)
# overwrite state to compute it based on department which itself is computed from zip
state_id
=
fields
.
Many2one
(
"
res.country.state
"
,
string
=
'
State
'
,
ondelete
=
'
restrict
'
,
domain
=
"
[(
'
country_id
'
,
'
=?
'
, country_id)]
"
,
related
=
"
country_department_id.state_id
"
,
)
# relations -----
ur_id
=
fields
.
Many2one
(
ur_id
=
fields
.
Many2one
(
comodel_name
=
"
union.regionale
"
,
comodel_name
=
"
union.regionale
"
,
string
=
"
Union Régionale
"
,
string
=
"
Union Régionale
"
,
...
@@ -33,6 +57,12 @@ class ResPartner(models.Model):
...
@@ -33,6 +57,12 @@ class ResPartner(models.Model):
# Computed fields / Search Fields
# Computed fields / Search Fields
# ------------------------------------------------------
# ------------------------------------------------------
@api.depends
(
"
siret
"
)
def
_compute_siren
(
self
):
for
partner
in
self
:
if
partner
.
siret
:
partner
.
siren
=
partner
.
siret
.
replace
(
"
"
,
""
)[
0
:
9
]
# ------------------------------------------------------
# ------------------------------------------------------
# Onchange / Constraints
# Onchange / Constraints
# ------------------------------------------------------
# ------------------------------------------------------
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
views/res_partner.xml
+
29
−
10
Voir le fichier @
7c89d4ec
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<odoo>
<!-- View -->
<!-- View -->
<!-- Form -->
<!-- Form -->
<record
id=
"view_partner_form"
model=
"ir.ui.view"
>
<record
id=
"view_partner_form
_inherit
"
model=
"ir.ui.view"
>
<field
name=
"name"
>
res.partner.form
</field>
<field
name=
"name"
>
res.partner.form
.inherit
</field>
<field
name=
"model"
>
res.partner
</field>
<field
name=
"model"
>
res.partner
</field>
<field
name=
"inherit_id"
ref=
"base.view_partner_form"
/>
<field
name=
"inherit_id"
ref=
"base.view_partner_form"
/>
<field
name=
"mode"
>
primary
</field>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//h1"
position=
"before"
>
<xpath
expr=
"//h1"
position=
"before"
>
<span
invisible=
"not is_company"
>
<span
invisible=
"not is_company"
>
...
@@ -16,6 +16,28 @@
...
@@ -16,6 +16,28 @@
<field
name=
"is_cooperative"
/>
<field
name=
"is_cooperative"
/>
</span>
</span>
</xpath>
</xpath>
<xpath
expr=
"//h1"
position=
"after"
>
<group
invisible=
"not is_company"
>
<group>
<field
name=
"ur_id"
invisible=
"not is_cooperative"
/>
<field
name=
"size_group"
/>
</group>
</group>
</xpath>
<xpath
expr=
"//field[@name='vat']"
position=
"after"
>
<field
name=
"siret"
readonly=
"1"
widget=
"CopyClipboardChar"
/>
<field
name=
"siren"
readonly=
"1"
widget=
"CopyClipboardChar"
/>
</xpath>
<xpath
expr=
"//page[@name='contact_addresses']"
position=
"before"
>
<page
name=
"company"
string=
"Company"
invisible=
"not is_company"
>
<group>
</group>
</page>
</xpath>
</field>
</field>
</record>
</record>
...
@@ -24,10 +46,11 @@
...
@@ -24,10 +46,11 @@
<field
name=
"name"
>
res.partner.list
</field>
<field
name=
"name"
>
res.partner.list
</field>
<field
name=
"model"
>
res.partner
</field>
<field
name=
"model"
>
res.partner
</field>
<field
name=
"inherit_id"
ref=
"base.view_partner_tree"
/>
<field
name=
"inherit_id"
ref=
"base.view_partner_tree"
/>
<field
name=
"mode"
>
primary
</field>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='complete_name']"
position=
"after"
>
<xpath
expr=
"//field[@name='complete_name']"
position=
"after"
>
<field
name=
"ur_id"
optional=
"hide"
/>
<field
name=
"ur_id"
optional=
"hide"
/>
<field
name=
"state_id"
optional=
"hide"
/>
<field
name=
"country_department_id"
optional=
"hide"
/>
</xpath>
</xpath>
</field>
</field>
</record>
</record>
...
@@ -37,7 +60,6 @@
...
@@ -37,7 +60,6 @@
<field
name=
"name"
>
res.partner.search
</field>
<field
name=
"name"
>
res.partner.search
</field>
<field
name=
"model"
>
res.partner
</field>
<field
name=
"model"
>
res.partner
</field>
<field
name=
"inherit_id"
ref=
"base.view_res_partner_filter"
/>
<field
name=
"inherit_id"
ref=
"base.view_res_partner_filter"
/>
<field
name=
"mode"
>
primary
</field>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"arch"
type=
"xml"
>
<!-- Search -->
<!-- Search -->
<xpath
expr=
"//field[@name='name']"
position=
"after"
>
<xpath
expr=
"//field[@name='name']"
position=
"after"
>
...
@@ -58,11 +80,8 @@
...
@@ -58,11 +80,8 @@
<!-- </xpath>-->
<!-- </xpath>-->
<!-- Group -->
<!-- Group -->
<xpath
expr=
"//filter[@name='salesperson']"
position=
"before"
>
<xpath
expr=
"//filter[@name='salesperson']"
position=
"before"
>
<!-- <filter-->
<filter
string=
"Région"
name=
"group_state_id"
<!-- string="A jour des cotisations"-->
context=
"{'group_by': 'state_id'}"
/>
<!-- name="group_ur_id"-->
<!-- context="{'group_by': 'ur_id'}"-->
<!-- />-->
</xpath>
</xpath>
</field>
</field>
</record>
</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