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
2ea3ba20
Valider
2ea3ba20
rédigé
9 févr. 2022
par
Benjamin - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[add] date_creation on domain export
parent
b03661f9
Branches
Branches contenant la validation
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
controllers/main.py
+18
-24
18 ajouts, 24 suppressions
controllers/main.py
wizard/export_journal_wizard.py
+8
-4
8 ajouts, 4 suppressions
wizard/export_journal_wizard.py
wizard/export_journal_wizard_view.xml
+17
-3
17 ajouts, 3 suppressions
wizard/export_journal_wizard_view.xml
avec
43 ajouts
et
31 suppressions
controllers/main.py
+
18
−
24
Voir le fichier @
2ea3ba20
...
...
@@ -19,7 +19,8 @@ class ExportJournalCg(http.Controller):
@http.route
(
'
/web/export_journal_cg/
'
,
type
=
'
http
'
,
auth
=
"
user
"
)
@serialize_exception
def
export_journal_cg
(
self
,
date_start
,
date_end
,
company_id
,
partner_ids
,
**
kwargs
):
self
,
date_start
,
date_end
,
date_creation_start
,
date_creation_end
,
company_id
,
partner_ids
,
**
kwargs
):
"""
Sélectionne les account.move.line correspondants aux journaux
et à la plage de date définis
...
...
@@ -39,11 +40,19 @@ class ExportJournalCg(http.Controller):
# Selection des dates + pas d'export du journal UR / FEDE
domain
=
[
(
'
date
'
,
'
>=
'
,
date_start
),
(
'
date
'
,
'
<=
'
,
date_end
),
(
'
partner_id
'
,
'
!=
'
,
False
),
(
'
journal_id
'
,
'
!=
'
,
contribution_ur_or_fede_journal_id
.
id
),
]
if
date_start
and
date_end
:
domain
+=
[
(
'
date
'
,
'
>=
'
,
date_start
),
(
'
date
'
,
'
<=
'
,
date_end
),
]
if
date_start
and
date_end
:
domain
+=
[
(
'
create_date
'
,
'
>=
'
,
date_creation_start
),
(
'
create_date
'
,
'
<=
'
,
date_creation_end
),
]
if
type
==
'
empty
'
:
domain
+=
[(
'
date_export
'
,
'
=
'
,
False
)]
...
...
@@ -69,17 +78,7 @@ class ExportJournalCg(http.Controller):
lines_to_export
.
append
(
self
.
_export_row
(
line
=
line
,
amount
=
amount_analytic
,
direction
=
direction
,
account
=
(
'
7060
'
+
line
.
partner_id
.
ur_id
.
code_ur
),
a_type
=
'
A
'
,
analytic
=
'
010201
'
)
)
lines_to_export
.
append
(
self
.
_export_row
(
line
=
line
,
amount
=
amount_analytic
,
direction
=
direction
,
account
=
(
'
7060
'
+
line
.
partner_id
.
ur_id
.
code_ur
),
a_type
=
'
A
'
,
analytic
=
'
020201
'
)
)
lines_to_export
.
append
(
self
.
_export_row
(
line
=
line
,
amount
=
round
(
amount
-
2
*
amount_analytic
,
2
),
direction
=
direction
,
account
=
(
'
7060
'
+
line
.
partner_id
.
ur_id
.
code_ur
),
a_type
=
'
A
'
,
analytic
=
'
030201
'
)
analytic
=
'
010000
'
)
)
# Produit Adhésion CG + Analytique + OD
elif
line
.
product_id
==
product_adhesion_id
:
...
...
@@ -87,18 +86,13 @@ class ExportJournalCg(http.Controller):
# Compte général
lines_to_export
.
append
(
self
.
_export_row
(
line
=
line
,
amount
=
amount
,
direction
=
direction
,
journal
=
'
VE
'
,
account
=
'
7
0
6200
'
)
journal
=
'
VE
'
,
account
=
'
7
5
6200
'
)
)
# Lignes analytiques
lines_to_export
.
append
(
self
.
_export_row
(
line
=
line
,
amount
=
amount_analytic
,
direction
=
direction
,
account
=
'
706200
'
,
journal
=
'
VE
'
,
a_type
=
'
A
'
,
analytic
=
'
010201
'
)
)
lines_to_export
.
append
(
self
.
_export_row
(
line
=
line
,
amount
=
amount_analytic
,
direction
=
direction
,
account
=
'
706200
'
,
journal
=
'
VE
'
,
a_type
=
'
A
'
,
analytic
=
'
020201
'
)
line
=
line
,
amount
=
amount
,
direction
=
direction
,
account
=
'
756200
'
,
journal
=
'
VE
'
,
a_type
=
'
A
'
,
analytic
=
'
010000
'
)
)
# OD Adhésion
lines_to_export
.
append
(
self
.
_export_row
(
...
...
@@ -114,7 +108,7 @@ class ExportJournalCg(http.Controller):
lines_to_export
.
append
(
self
.
_export_row
(
line
=
line
,
amount
=
amount
/
2
,
direction
=
'
D
'
,
account
=
(
'
6581
'
+
line
.
partner_id
.
ur_id
.
code_ur
),
journal
=
'
OD
'
,
a_type
=
'
A
'
,
analytic
=
'
0
20201
'
)
journal
=
'
OD
'
,
a_type
=
'
A
'
,
analytic
=
'
0
10000
'
)
)
# Compte client CG Scop - Adhésion & Cotisation
elif
line
.
account_id
==
default_receivable_account_id
:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
wizard/export_journal_wizard.py
+
8
−
4
Voir le fichier @
2ea3ba20
...
...
@@ -20,11 +20,13 @@ class ExportJournalWizard(models.TransientModel):
(
'
company_id
'
,
'
=
'
,
self
.
env
.
user
.
company_id
.
id
)],
limit
=
1
)
return
export
date_start
=
fields
.
Date
(
'
Date de début
'
,
required
=
True
)
date_start
=
fields
.
Date
(
'
Date de début
des écritures
'
)
date_end
=
fields
.
Date
(
string
=
'
Date de fin
'
,
required
=
True
,
default
=
fields
.
Date
.
today
())
string
=
'
Date de fin des écritures
'
)
date_creation_start
=
fields
.
Date
(
'
Date de début (création des écritures)
'
)
date_creation_end
=
fields
.
Date
(
string
=
'
Date de fin (création des écritures)
'
)
company_id
=
fields
.
Many2one
(
comodel_name
=
'
res.company
'
,
...
...
@@ -48,6 +50,8 @@ class ExportJournalWizard(models.TransientModel):
'
export_type
'
:
self
.
export_type
,
'
date_start
'
:
self
.
date_start
,
'
date_end
'
:
self
.
date_end
,
'
date_creation_start
'
:
self
.
date_creation_start
,
'
date_creation_end
'
:
self
.
date_creation_end
,
'
company_id
'
:
self
.
company_id
.
id
,
'
partner_ids
'
:
'
,
'
.
join
(
str
(
x
)
for
x
in
self
.
partner_ids
.
ids
),
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
wizard/export_journal_wizard_view.xml
+
17
−
3
Voir le fichier @
2ea3ba20
...
...
@@ -13,14 +13,28 @@
</group>
<p
class=
"text-muted"
>
Les dates de début et de fin sont incluses dans l'export des écritures
</p>
<hr/>
<p
style=
"background: #f0f0f0; padding: 5px"
><u>
Sélection sur la plage de
<strong>
date d'écriture
</strong>
:
</u></p>
<group
name=
"date"
>
<group>
<field
name=
"date_start"
attrs=
"{'required': [('date_end', '!=', False)]}"
/>
</group>
<group>
<field
name=
"date_end"
attrs=
"{'required': [('date_start', '!=', False)]}"
/>
</group>
</group>
<hr/>
<p
style=
"background: #f0f0f0; padding: 5px"
><u>
Sélection sur la plage de
<strong>
date de création de l'écriture
</strong>
:
</u></p>
<group
name=
"date"
>
<group>
<field
name=
"date_
start
"
/>
<field
name=
"date_
creation_start"
attrs=
"{'required': [('date_creation_end', '!=', False)]}
"
/>
</group>
<group>
<field
name=
"date_
end
"
/>
<field
name=
"date_
creation_end"
attrs=
"{'required': [('date_creation_start', '!=', False)]}
"
/>
</group>
</group>
<hr/>
<p
style=
"background: #f0f0f0; padding: 5px"
><u>
Sélection des coopératives (si souhaité) :
</u></p>
<group>
<field
name=
"partner_ids"
widget=
"many2many_tags"
options=
"{'no_create': True, 'no_edit': True}"
/>
</group>
...
...
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