Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
A
adefpat_account
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
Adefpat
adefpat_account
Validations
2e8fc04c
Valider
2e8fc04c
rédigé
18 févr. 2021
par
Juliana
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Add Payment term id + change product account
parent
12656277
Branches
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
4
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
__manifest__.py
+1
-0
1 ajout, 0 suppression
__manifest__.py
data/account_data.xml
+17
-0
17 ajouts, 0 suppression
data/account_data.xml
models/product_template.py
+2
-2
2 ajouts, 2 suppressions
models/product_template.py
models/project.py
+9
-5
9 ajouts, 5 suppressions
models/project.py
avec
29 ajouts
et
7 suppressions
__manifest__.py
+
1
−
0
Voir le fichier @
2e8fc04c
...
...
@@ -15,6 +15,7 @@
'
data
'
:
[
# "security/ir.model.access.csv",
# datas
'
data/account_data.xml
'
,
'
report/account_invoice_template.xml
'
,
# views
'
views/project_views.xml
'
,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
data/account_data.xml
0 → 100644
+
17
−
0
Voir le fichier @
2e8fc04c
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data
noupdate=
"1"
>
<!--
Payment terms
-->
<record
id=
"account_payment_term_adefpat"
model=
"account.payment.term"
>
<field
name=
"name"
>
Conditions Adefpat
</field>
<field
name=
"note"
>
Payable à l’ordre de l’ADEFPAT par chèque bancaire ou virement
Banque Crédit Coopératif Toulouse
IBAN : FR76 4255 9100 0008 0124 2734 242
CODE BIC : CCOPFRPPXXX
</field>
</record>
</data>
</odoo>
Ce diff est replié.
Cliquez pour l'agrandir.
models/product_template.py
+
2
−
2
Voir le fichier @
2e8fc04c
...
...
@@ -11,8 +11,8 @@ class ProductTemplate(models.Model):
# Fields declaration
# ------------------------------------------------------
type_product
=
fields
.
Selection
([
(
'
p
hysical
'
,
'
Personne physique
'
),
(
'
moral
'
,
'
Personne morale
'
)],
(
'
p
articular
'
,
'
Particulier
'
),
(
'
collectivite
'
,
'
Collectivités
'
)],
string
=
"
Type de contact
"
)
# ------------------------------------------------------
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
models/project.py
+
9
−
5
Voir le fichier @
2e8fc04c
...
...
@@ -61,13 +61,15 @@ class Project(models.Model):
for
benef
in
project
.
financement_ids
:
if
benef
.
partner_id
.
parent_id
:
partner
=
benef
.
partner_id
.
parent_id
# search the product corresponding to the company associated
product_id
=
self
.
env
[
'
product.product
'
].
search
([(
'
type_product
'
,
'
=
'
,
'
moral
'
)])
else
:
partner
=
benef
.
partner_id
# search the product corresponding to the partner person
product_id
=
self
.
env
[
'
product.product
'
].
search
([(
'
type_product
'
,
'
=
'
,
'
physical
'
)])
if
partner
.
type_structure_id
:
# search the product corresponding to the company associated
product_id
=
self
.
env
[
'
product.product
'
].
search
([(
'
type_product
'
,
'
=
'
,
'
collectivite
'
)])
else
:
# search the product corresponding to the company associated
product_id
=
self
.
env
[
'
product.product
'
].
search
([(
'
type_product
'
,
'
=
'
,
'
particular
'
)])
# Search if account already exists for the partner of the project
account
=
self
.
env
[
'
account.invoice
'
].
sudo
().
search
([
(
'
project_id
'
,
'
=
'
,
self
.
id
),
...
...
@@ -83,7 +85,7 @@ class Project(models.Model):
Invoice
=
self
.
env
[
'
account.invoice
'
]
InvoiceLine
=
self
.
env
[
'
account.invoice.line
'
]
journal_id
=
self
.
env
[
'
account.journal
'
].
search
([(
'
company_id
'
,
'
=
'
,
self
.
env
.
user
.
company_id
.
id
)],
limit
=
1
)
payment_term_id
=
self
.
env
.
ref
(
'
adefpat_account.account_payment_term_adefpat
'
)
benef_invoice
=
Invoice
.
create
({
'
name
'
:
partner
.
name
,
'
project_id
'
:
self
.
id
,
...
...
@@ -92,10 +94,12 @@ class Project(models.Model):
'
journal_id
'
:
journal_id
.
id
,
'
state
'
:
'
draft
'
,
'
account_id
'
:
product
.
property_account_income_id
.
id
,
'
payment_term_id
'
:
payment_term_id
.
id
})
# Création de la ligne CG Scop
benef_invoice_line
=
InvoiceLine
.
create
({
'
name
'
:
product
.
name
,
'
invoice_id
'
:
benef_invoice
.
id
,
'
product_id
'
:
product
.
id
,
'
account_id
'
:
product
.
property_account_income_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