Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
C
cgscop_cotisation_cg
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
Confédération Générale des SCOP
cgscop_cotisation_cg
Validations
ddd9345b
Valider
ddd9345b
rédigé
Il y a 3 ans
par
Benjamin - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[update] wizard new member
parent
6655de94
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
wizard/scop_cotisation_cg_wizard.py
+46
-18
46 ajouts, 18 suppressions
wizard/scop_cotisation_cg_wizard.py
wizard/scop_cotisation_cg_wizard.xml
+19
-1
19 ajouts, 1 suppression
wizard/scop_cotisation_cg_wizard.xml
avec
65 ajouts
et
19 suppressions
wizard/scop_cotisation_cg_wizard.py
+
46
−
18
Voir le fichier @
ddd9345b
...
@@ -12,12 +12,24 @@ class ScopCotisationWizard(models.TransientModel):
...
@@ -12,12 +12,24 @@ class ScopCotisationWizard(models.TransientModel):
_name
=
'
scop.cotisation.cg.wizard
'
_name
=
'
scop.cotisation.cg.wizard
'
_description
=
"
Wizard: Génération des cotisations nouveaux adhérents
"
_description
=
"
Wizard: Génération des cotisations nouveaux adhérents
"
@api.model
def
_default_cotisation_cg_id
(
self
):
return
self
.
env
.
context
.
get
(
"
active_id
"
)
@api.model
def
_default_year
(
self
):
return
self
.
env
[
"
scop.cotisation.cg
"
].
browse
(
self
.
env
.
context
.
get
(
"
active_id
"
)).
year
year
=
fields
.
Char
(
year
=
fields
.
Char
(
string
=
'
Année
'
,
string
=
'
Année
'
,
required
=
True
)
required
=
True
,
default
=
_default_year
)
cotisation_cg_id
=
fields
.
Many2one
(
cotisation_cg_id
=
fields
.
Many2one
(
comodel_name
=
'
scop.cotisation.cg
'
,
comodel_name
=
'
scop.cotisation.cg
'
,
string
=
'
Base de cotisation
'
)
string
=
'
Base de cotisation
'
,
default
=
_default_cotisation_cg_id
)
nb_quarter
=
fields
.
Selection
(
nb_quarter
=
fields
.
Selection
(
string
=
'
Nombre de trimestres de cotisation
'
,
string
=
'
Nombre de trimestres de cotisation
'
,
selection
=
[(
1
,
'
1
'
),
selection
=
[(
1
,
'
1
'
),
...
@@ -36,24 +48,32 @@ class ScopCotisationWizard(models.TransientModel):
...
@@ -36,24 +48,32 @@ class ScopCotisationWizard(models.TransientModel):
comodel_name
=
'
res.partner
'
,
comodel_name
=
'
res.partner
'
,
string
=
'
Coopératives
'
string
=
'
Coopératives
'
)
)
date
=
fields
.
Date
(
'
Date de cotisation
'
,
default
=
fields
.
Date
.
today
())
date
=
fields
.
Date
(
'
Date du bordereau
'
,
default
=
fields
.
Date
.
today
())
date_start
=
fields
.
Date
(
'
Adhésion après le
'
)
date_limit
=
fields
.
Date
(
'
Adhésion avant le
'
)
# ------------------------------------------------------
# ------------------------------------------------------
# Button function
# Button function
# ------------------------------------------------------
# ------------------------------------------------------
@api.onchange
(
'
type
'
)
@api.onchange
(
"
type
"
,
"
date_start
"
,
"
date_limit
"
)
def
onchange_domain_partner_ids
(
self
):
def
onchange_domain_partner_ids
(
self
):
if
self
.
type
==
'
selected
'
:
if
self
.
type
==
'
selected
'
:
id_cotisation_cg
=
self
.
env
.
context
[
'
id_cotisation_cg
'
]
invoiced_members
=
self
.
cotisation_cg_id
.
bordereau_ids
.
mapped
(
'
partner_id
'
)
invoiced_members
=
self
.
cotisation_cg_id
.
browse
(
domain
=
[
id_cotisation_cg
).
invoice_ids
.
mapped
(
'
partner_id
'
)
(
"
is_cooperative
"
,
"
=
"
,
True
),
(
"
type
"
,
"
!=
"
,
"
facility
"
),
res
=
{
'
domain
'
:
{
(
"
id
"
,
"
not in
"
,
invoiced_members
.
mapped
(
"
id
"
)),
'
partner_ids
'
:
[
]
(
'
is_company
'
,
'
=
'
,
True
),
if
self
.
date_limit
:
(
'
type
'
,
'
!=
'
,
'
facility
'
),
domain
.
append
((
"
member_start
"
,
"
<=
"
,
self
.
date_limit
))
(
'
id
'
,
'
not in
'
,
invoiced_members
.
mapped
(
'
id
'
))]
if
self
.
date_start
:
}}
domain
.
append
((
"
member_start
"
,
"
>=
"
,
self
.
date_start
))
res
=
{
"
domain
"
:
{
"
partner_ids
"
:
domain
}
}
return
res
return
res
# ------------------------------------------------------
# ------------------------------------------------------
...
@@ -68,10 +88,18 @@ class ScopCotisationWizard(models.TransientModel):
...
@@ -68,10 +88,18 @@ class ScopCotisationWizard(models.TransientModel):
if
self
.
type
==
'
selected
'
:
if
self
.
type
==
'
selected
'
:
members
=
self
.
partner_ids
members
=
self
.
partner_ids
else
:
else
:
members
=
self
.
cotisation_cg_id
.
get_new_members
(
self
.
date
)
domain
=
[
(
"
is_cooperative
"
,
"
=
"
,
True
),
invoiced_members
=
self
.
cotisation_cg_id
.
\
(
"
membership_status
"
,
"
=
"
,
"
member
"
),
invoice_ids
.
mapped
(
'
partner_id
'
)
(
"
type
"
,
"
!=
"
,
"
facility
"
),
]
if
self
.
date_limit
:
domain
.
append
((
"
member_start
"
,
"
<=
"
,
self
.
date_limit
))
if
self
.
date_start
:
domain
.
append
((
"
member_start
"
,
"
>=
"
,
self
.
date_start
))
members
=
self
.
env
[
"
res.partner
"
].
search
(
domain
)
invoiced_members
=
self
.
cotisation_cg_id
.
bordereau_ids
.
mapped
(
'
partner_id
'
)
members_to_invoice
=
members
-
invoiced_members
members_to_invoice
=
members
-
invoiced_members
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
wizard/scop_cotisation_cg_wizard.xml
+
19
−
1
Voir le fichier @
ddd9345b
...
@@ -14,9 +14,27 @@
...
@@ -14,9 +14,27 @@
<field
name=
"year"
required=
"1"
invisible=
"1"
/>
<field
name=
"year"
required=
"1"
invisible=
"1"
/>
<field
name=
"date"
required=
"1"
/>
<field
name=
"date"
required=
"1"
/>
<field
name=
"nb_quarter"
required=
"1"
/>
<field
name=
"nb_quarter"
required=
"1"
/>
<field
name=
"date_start"
/>
<field
name=
"date_limit"
/>
<separator
/>
<field
name=
"type"
widget=
"radio"
/>
<field
name=
"type"
widget=
"radio"
/>
<field
name=
"partner_ids"
attrs=
"{'invisible': [('type', '=', 'all')]}"
widget=
"many2many_tags"
options=
"{'no_create': True, 'no_open': True}"
/>
</group>
</group>
<label
for=
"partner_ids"
attrs=
"{'invisible': [('type', '=', 'all')]}"
/>
<field
name=
"partner_ids"
attrs=
"{'invisible': [('type', '=', 'all')]}"
options=
"{'no_create': True, 'no_open': True}"
widget=
"many2many"
mode=
"tree"
>
<tree>
<field
name=
"member_number"
string=
"N° Adhérent"
/>
<field
name=
"name"
/>
<field
name=
"ur_id"
/>
<field
name=
"member_start"
/>
<field
name=
"member_start_stat"
/>
</tree>
</field>
<footer>
<footer>
<button
name=
"cotiz_generate_new_adherents"
type=
"object"
<button
name=
"cotiz_generate_new_adherents"
type=
"object"
string=
"Générer les cotisations"
class=
"oe_highlight"
/>
string=
"Générer les cotisations"
class=
"oe_highlight"
/>
...
...
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