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
e8f8bf57
Valider
e8f8bf57
rédigé
Il y a 2 ans
par
Benjamin - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[fix] migrations error (account.invoice)
parent
7ec34383
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
wizard/scop_cotisation_cg_regul.py
+28
-24
28 ajouts, 24 suppressions
wizard/scop_cotisation_cg_regul.py
avec
28 ajouts
et
24 suppressions
wizard/scop_cotisation_cg_regul.py
+
28
−
24
Voir le fichier @
e8f8bf57
...
@@ -74,7 +74,7 @@ class ScopCotisationRegul(models.TransientModel):
...
@@ -74,7 +74,7 @@ class ScopCotisationRegul(models.TransientModel):
# ------------------------------------------------------
# ------------------------------------------------------
@api.constrains
(
"
date_regul
"
)
@api.constrains
(
"
date_regul
"
)
def
_check_date_regul
(
self
):
def
_check_date_regul
(
self
):
last_date
=
max
(
self
.
bordereau_id
.
invoice_ids
.
mapped
(
"
date_
invoice
"
))
last_date
=
max
(
self
.
bordereau_id
.
invoice_ids
.
mapped
(
"
invoice
_date
"
))
if
self
.
date_regul
>
fields
.
Date
.
today
()
or
self
.
date_regul
<
last_date
:
if
self
.
date_regul
>
fields
.
Date
.
today
()
or
self
.
date_regul
<
last_date
:
raise
ValidationError
(
raise
ValidationError
(
_
(
_
(
...
@@ -111,7 +111,7 @@ class ScopCotisationRegul(models.TransientModel):
...
@@ -111,7 +111,7 @@ class ScopCotisationRegul(models.TransientModel):
detail
+=
"
</table>
"
detail
+=
"
</table>
"
payments
=
list
(
payments
=
list
(
map
(
map
(
lambda
i
:
True
if
i
.
payment_
move_line_ids
else
False
,
lambda
i
:
True
if
i
.
move_line_
payment_
ids
else
False
,
bordereau_id
.
invoice_ids
,
bordereau_id
.
invoice_ids
,
)
)
)
)
...
@@ -227,7 +227,7 @@ class ScopCotisationRegul(models.TransientModel):
...
@@ -227,7 +227,7 @@ class ScopCotisationRegul(models.TransientModel):
refund_amount_total
*=
-
1
refund_amount_total
*=
-
1
elif
refund_amount_total
>
0
:
elif
refund_amount_total
>
0
:
type_invoice
=
"
out_refund
"
type_invoice
=
"
out_refund
"
refund_amount
=
refund_amount_total
/
bordereau_id
.
nb_quarter
refund_amount
=
refund_amount_total
/
int
(
bordereau_id
.
nb_quarter
)
if
type_invoice
:
if
type_invoice
:
for
i
in
range
(
0
,
int
(
bordereau_id
.
nb_quarter
)):
for
i
in
range
(
0
,
int
(
bordereau_id
.
nb_quarter
)):
...
@@ -237,38 +237,42 @@ class ScopCotisationRegul(models.TransientModel):
...
@@ -237,38 +237,42 @@ class ScopCotisationRegul(models.TransientModel):
else
:
else
:
date_due
=
self
.
date_regul
date_due
=
self
.
date_regul
refund
=
self
.
env
[
"
account.
invoic
e
"
].
create
(
self
.
env
[
"
account.
mov
e
"
].
create
(
{
{
"
partner_id
"
:
partner_id
.
id
,
"
partner_id
"
:
partner_id
.
id
,
"
journal_id
"
:
cotiz_type
.
get
(
type_cotiz
)[
2
].
id
,
"
journal_id
"
:
cotiz_type
.
get
(
type_cotiz
)[
2
].
id
,
"
type
"
:
type_invoice
,
"
move_
type
"
:
type_invoice
,
"
date_
invoice
"
:
self
.
date_regul
,
"
invoice
_date
"
:
self
.
date_regul
,
"
date
"
:
self
.
date_regul
,
"
date
"
:
self
.
date_regul
,
"
state
"
:
"
draft
"
,
"
state
"
:
"
draft
"
,
"
number
"
:
False
,
"
invoice_origin
"
:
bordereau_id
.
name
,
"
origin
"
:
bordereau_id
.
name
,
"
ref
"
:
self
.
comment
,
"
name
"
:
self
.
comment
,
"
bordereau_id
"
:
bordereau_id
.
id
,
"
bordereau_id
"
:
bordereau_id
.
id
,
"
is_contribution
"
:
True
,
"
is_contribution
"
:
True
,
"
year
"
:
bordereau_id
.
year
,
"
year
"
:
bordereau_id
.
year
,
"
liasse_fiscale_id
"
:
bordereau_id
.
liasse_fiscale_id
.
id
,
"
liasse_fiscale_id
"
:
bordereau_id
.
liasse_fiscale_id
.
id
,
"
type_contribution_id
"
:
type_cotiz
,
"
type_contribution_id
"
:
type_cotiz
,
"
payment_mode_id
"
:
bordereau_id
.
payment_mode_id
.
id
,
"
payment_mode_id
"
:
bordereau_id
.
payment_mode_id
.
id
,
"
date_due
"
:
date_due
,
"
invoice_date_due
"
:
date_due
,
"
cotiz_quarter
"
:
i
+
1
,
"
cotiz_quarter
"
:
str
(
i
+
1
),
}
"
invoice_line_ids
"
:
[
)
(
self
.
env
[
"
account.invoice.line
"
].
create
(
0
,
None
,
{
{
"
product_id
"
:
product
.
id
,
"
account_id
"
:
product
.
property_account_income_id
.
id
,
"
tax_ids
"
:
[(
6
,
0
,
product
.
taxes_id
.
ids
)],
"
name
"
:
self
.
comment
"
name
"
:
self
.
comment
+
"
-
"
+
"
-
"
+
str
(
i
+
1
)
+
str
(
i
+
1
)
+
"
/
"
+
"
/
"
+
bordereau_id
.
nb_quarter
,
+
bordereau_id
.
nb_quarter
,
"
invoice_id
"
:
refund
.
id
,
"
product_id
"
:
product
.
id
,
"
account_id
"
:
product
.
property_account_income_id
.
id
,
"
price_unit
"
:
refund_amount
,
"
price_unit
"
:
refund_amount
,
"
price_subtotal
"
:
refund_amount
,
},
),
],
}
}
)
)
bordereau_id
.
update
({
"
liasse_fiscale_id
"
:
self
.
liasse_fiscale_new_id
.
id
})
bordereau_id
.
update
({
"
liasse_fiscale_id
"
:
self
.
liasse_fiscale_new_id
.
id
})
...
...
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