Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
C
cgscop_invoice_idf
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_invoice_idf
Validations
561a40f6
Valider
561a40f6
rédigé
9 nov. 2023
par
Benjamin - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[UPD] load data exceptions
parent
2848fe6b
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
.pre-commit-config.yaml
+19
-16
19 ajouts, 16 suppressions
.pre-commit-config.yaml
wizard/scop_invoice_idf_wizard.py
+67
-54
67 ajouts, 54 suppressions
wizard/scop_invoice_idf_wizard.py
avec
86 ajouts
et
70 suppressions
.pre-commit-config.yaml
+
19
−
16
Voir le fichier @
561a40f6
...
@@ -6,6 +6,8 @@ exclude: |
...
@@ -6,6 +6,8 @@ exclude: |
^setup/|/static/description/index\.html$|
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
# We don't want to mess with tool-generated files
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
# Library files can have extraneous formatting (even minimized)
/static/(src/)?lib/|
/static/(src/)?lib/|
# Repos using Sphinx to generate docs don't need prettying
# Repos using Sphinx to generate docs don't need prettying
...
@@ -25,8 +27,13 @@ repos:
...
@@ -25,8 +27,13 @@ repos:
entry
:
found forbidden files; remove them
entry
:
found forbidden files; remove them
language
:
fail
language
:
fail
files
:
"
\\
.rej$"
files
:
"
\\
.rej$"
-
id
:
en-po-files
name
:
en.po files cannot exist
entry
:
found a en.po file
language
:
fail
files
:
'
[a-zA-Z0-9_]*/i18n/en\.po$'
-
repo
:
https://github.com/oca/maintainer-tools
-
repo
:
https://github.com/oca/maintainer-tools
rev
:
7d8a9f9ad73db0976fb03cbee43d953bc29b89e9
rev
:
ab1d7f6
hooks
:
hooks
:
# update the NOT INSTALLABLE ADDONS section above
# update the NOT INSTALLABLE ADDONS section above
-
id
:
oca-update-pre-commit-excluded-addons
-
id
:
oca-update-pre-commit-excluded-addons
...
@@ -48,7 +55,7 @@ repos:
...
@@ -48,7 +55,7 @@ repos:
hooks
:
hooks
:
-
id
:
black
-
id
:
black
-
repo
:
https://github.com/pre-commit/mirrors-prettier
-
repo
:
https://github.com/pre-commit/mirrors-prettier
rev
:
v2.
6
.2
rev
:
v2.
1
.2
hooks
:
hooks
:
-
id
:
prettier
-
id
:
prettier
name
:
prettier (with plugin-xml)
name
:
prettier (with plugin-xml)
...
@@ -59,7 +66,7 @@ repos:
...
@@ -59,7 +66,7 @@ repos:
-
--plugin=@prettier/plugin-xml
-
--plugin=@prettier/plugin-xml
files
:
\.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
files
:
\.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
-
repo
:
https://github.com/pre-commit/mirrors-eslint
-
repo
:
https://github.com/pre-commit/mirrors-eslint
rev
:
v8.1
5.0
rev
:
v
7.
8.1
hooks
:
hooks
:
-
id
:
eslint
-
id
:
eslint
verbose
:
true
verbose
:
true
...
@@ -67,7 +74,7 @@ repos:
...
@@ -67,7 +74,7 @@ repos:
-
--color
-
--color
-
--fix
-
--fix
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
rev
:
v
4
.2.0
rev
:
v
3
.2.0
hooks
:
hooks
:
-
id
:
trailing-whitespace
-
id
:
trailing-whitespace
# exclude autogenerated files
# exclude autogenerated files
...
@@ -89,37 +96,33 @@ repos:
...
@@ -89,37 +96,33 @@ repos:
-
id
:
mixed-line-ending
-
id
:
mixed-line-ending
args
:
[
"
--fix=lf"
]
args
:
[
"
--fix=lf"
]
-
repo
:
https://github.com/asottile/pyupgrade
-
repo
:
https://github.com/asottile/pyupgrade
rev
:
v2.
32.1
rev
:
v2.
7.2
hooks
:
hooks
:
-
id
:
pyupgrade
-
id
:
pyupgrade
args
:
[
"
--keep-percent-format"
]
args
:
[
"
--keep-percent-format"
]
-
repo
:
https://github.com/PyCQA/isort
-
repo
:
https://github.com/PyCQA/isort
rev
:
5.1
0.1
rev
:
5.1
2.0
hooks
:
hooks
:
-
id
:
isort
-
id
:
isort
name
:
isort except __init__.py
name
:
isort except __init__.py
args
:
args
:
-
--settings=.
-
--settings=.
exclude
:
/__init__\.py$
exclude
:
/__init__\.py$
-
repo
:
https://git
la
b.com/PyCQA/flake8
-
repo
:
https://git
hu
b.com/PyCQA/flake8
rev
:
3.
9.2
rev
:
3.
8.3
hooks
:
hooks
:
-
id
:
flake8
-
id
:
flake8
name
:
flake8
name
:
flake8
additional_dependencies
:
[
"
flake8-bugbear==20.1.4"
]
additional_dependencies
:
[
"
flake8-bugbear==20.1.4"
]
-
repo
:
https://github.com/
PyCQ
A/pylint
-
repo
:
https://github.com/
OC
A/pylint
-odoo
rev
:
v2.11.1
rev
:
7.0.2
hooks
:
hooks
:
-
id
:
pylint
-
id
:
pylint
_odoo
name
:
pylint with optional checks
name
:
pylint with optional checks
args
:
args
:
-
--rcfile=.pylintrc
-
--rcfile=.pylintrc
-
--exit-zero
-
--exit-zero
verbose
:
true
verbose
:
true
additional_dependencies
:
&pylint_deps
-
id
:
pylint_odoo
-
pylint-odoo==5.0.5
-
id
:
pylint
name
:
pylint with mandatory checks
args
:
args
:
-
--rcfile=.pylintrc-mandatory
-
--rcfile=.pylintrc-mandatory
additional_dependencies
:
*pylint_deps
Ce diff est replié.
Cliquez pour l'agrandir.
wizard/scop_invoice_idf_wizard.py
+
67
−
54
Voir le fichier @
561a40f6
...
@@ -6,6 +6,8 @@ import csv
...
@@ -6,6 +6,8 @@ import csv
import
mimetypes
import
mimetypes
from
io
import
StringIO
from
io
import
StringIO
from
dateutil.parser
import
parse
from
odoo
import
_
,
api
,
fields
,
models
from
odoo
import
_
,
api
,
fields
,
models
from
odoo.exceptions
import
UserError
from
odoo.exceptions
import
UserError
from
odoo.tools.mimetypes
import
guess_mimetype
from
odoo.tools.mimetypes
import
guess_mimetype
...
@@ -105,6 +107,15 @@ class ScopImportIDFWizard(models.TransientModel):
...
@@ -105,6 +107,15 @@ class ScopImportIDFWizard(models.TransientModel):
if
journal
in
[
"
VE
"
,
"
BFC
"
]:
if
journal
in
[
"
VE
"
,
"
BFC
"
]:
tried_lines
+=
1
tried_lines
+=
1
compte
=
row
[
"
Compte
"
]
compte
=
row
[
"
Compte
"
]
if
not
compte
[
2
:
7
].
isdigit
():
logs
+=
(
"
<li> Ligne
"
+
str
(
line
)
+
"
: Le compte
"
+
compte
+
"
n
'
est pas lié à un adhérent</li>
"
)
else
:
partner_id
=
self
.
env
[
"
res.partner
"
].
search
(
partner_id
=
self
.
env
[
"
res.partner
"
].
search
(
[
[
[
"
member_number_int
"
,
"
=
"
,
int
(
compte
[
2
:
7
])],
[
"
member_number_int
"
,
"
=
"
,
int
(
compte
[
2
:
7
])],
...
@@ -120,7 +131,7 @@ class ScopImportIDFWizard(models.TransientModel):
...
@@ -120,7 +131,7 @@ class ScopImportIDFWizard(models.TransientModel):
+
"
</li>
"
+
"
</li>
"
)
)
else
:
else
:
writing_date
=
row
[
"
Date écriture
"
]
writing_date
=
parse
(
row
[
"
Date écriture
"
]
)
libelle
=
row
[
"
Libellé écriture
"
]
libelle
=
row
[
"
Libellé écriture
"
]
existing_import_line
=
self
.
env
[
model
].
search
(
existing_import_line
=
self
.
env
[
model
].
search
(
[
[
...
@@ -137,7 +148,9 @@ class ScopImportIDFWizard(models.TransientModel):
...
@@ -137,7 +148,9 @@ class ScopImportIDFWizard(models.TransientModel):
credit
=
float
(
row
[
"
Crédit euro
"
].
replace
(
"
,
"
,
"
.
"
))
credit
=
float
(
row
[
"
Crédit euro
"
].
replace
(
"
,
"
,
"
.
"
))
if
debit
>
0
and
credit
>
0
:
if
debit
>
0
and
credit
>
0
:
logs
+=
(
logs
+=
(
"
<li> Ligne
"
+
str
(
line
)
+
"
: Montants incorrects</li>
"
"
<li> Ligne
"
+
str
(
line
)
+
"
: Montants incorrects</li>
"
)
)
else
:
else
:
if
journal
==
"
VE
"
and
debit
>
0
:
if
journal
==
"
VE
"
and
debit
>
0
:
...
...
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