Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
O
oacc_portal_account_surplus
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
Opération Auto-Consommation Collective
oacc_portal_account_surplus
Comparer les révisions
cf9ba7805bd008337fd2a0792a9cdb24ad77f4d3 to eb339a328ce81891d24dfa056f53ea6e0dd8ab50
Comparer les révisions
Les modifications sont affichées comme si la révision
source
était fusionnée avec la révision
cible
.
En savoir plus sur la comparaison des révisions.
Source
lefilament/oacc/oacc_portal_account_surplus
Sélectionner le projet cible
No results found
eb339a328ce81891d24dfa056f53ea6e0dd8ab50
Sélectionner une révision Git
Branches
16.0
1 résultat
Échanger
Cible
lefilament/oacc/oacc_portal_account_surplus
Sélectionner le projet cible
lefilament/oacc/oacc_portal_account_surplus
arthur-enercoop/oacc_portal_account_surplus
2 résultats
cf9ba7805bd008337fd2a0792a9cdb24ad77f4d3
Sélectionner une révision Git
Branches
16.0
1 résultat
Afficher les modifications
Uniquement les modifications entrantes de la source
Inclure les modifications apportées à la cible depuis la création de la source
Comparer
Validations sur la source (2)
[UPD] portal template
· ed269ee5
Benjamin - Le Filament
a rédigé
Il y a 1 an
ed269ee5
[UPD] portal and values
· eb339a32
Rémi - Le Filament
a rédigé
Il y a 1 an
eb339a32
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
controllers/main.py
+6
-34
6 ajouts, 34 suppressions
controllers/main.py
templates/operation_templates_page.xml
+14
-191
14 ajouts, 191 suppressions
templates/operation_templates_page.xml
avec
20 ajouts
et
225 suppressions
controllers/main.py
Voir le fichier @
eb339a32
...
...
@@ -10,7 +10,7 @@ from odoo.addons.http_routing.models.ir_http import slug
class
PortalAccount
(
PortalAccount
):
def
_prepare_invoice_surplus_portal_values
(
self
,
operation
,
domain
,
order
):
def
_prepare_invoice_surplus_portal_values
(
self
,
operation
,
order
):
"""
Get all surplus invoices matching domain
"""
...
...
@@ -18,7 +18,6 @@ class PortalAccount(PortalAccount):
values
.
update
(
self
.
_get_role
(
operation
))
domain
=
expression
.
AND
(
[
domain
,
[(
"
acc_operation_id
"
,
"
=
"
,
operation
.
id
)],
[(
"
acc_delivery_id
"
,
"
=
"
,
False
)],
[
...
...
@@ -65,16 +64,6 @@ class PortalAccount(PortalAccount):
values
[
"
invoices_surplus
"
]
=
request
.
env
[
"
account.move
"
].
sudo
().
search
(
domain
)
return
values
def
_get_operation_values
(
self
,
operation
):
render_values
=
super
().
_get_operation_values
(
operation
)
if
operation
.
is_surplus_active
:
render_values
[
"
ope_invoices_surplus
"
]
=
self
.
_prepare_invoice_surplus_portal_values
(
operation
=
operation
,
domain
=
[],
order
=
"
name desc
"
)[
"
invoices_surplus
"
]
return
render_values
@http.route
(
[
'
/operation/<model(
"
acc.operation
"
):operation>/invoices-surplus
'
,
...
...
@@ -89,38 +78,21 @@ class PortalAccount(PortalAccount):
"""
List all surplus invoices
"""
render_values
=
self
.
_get_operation_values
(
operation
)
searchbar_sortings
=
self
.
_get_account_searchbar_sortings
()
# default sort by order
if
not
sortby
:
sortby
=
"
date
"
order
=
searchbar_sortings
[
sortby
][
"
order
"
]
domain
=
[]
searchbar_filters
=
self
.
_get_account_searchbar_filters
()
# default filter by value
if
not
filterby
:
filterby
=
"
all
"
domain
+=
searchbar_filters
[
filterby
][
"
domain
"
]
render_values
=
{}
render_values
.
update
(
self
.
_get_role
(
operation
))
searchbar_inputs
=
self
.
_get_account_searchbar_inputs
()
if
search
and
search_in
:
domain
+=
self
.
_get_account_search_domain
(
search_in
,
search
)
order
=
"
state, name desc, start_date desc, partner_id
"
render_values
[
"
invoices_surplus
"
]
=
self
.
_prepare_invoice_surplus_portal_values
(
operation
,
domain
,
order
operation
,
order
)[
"
invoices_surplus
"
]
render_values
.
update
(
{
"
default_url
"
:
"
/operation/
"
+
slug
(
operation
)
+
"
/invoices-surplus
"
,
"
page_name
"
:
"
invoice-surplus
"
,
"
search_in
"
:
search_in
,
"
search
"
:
search
,
"
sortby
"
:
sortby
,
"
filterby
"
:
filterby
,
"
searchbar_inputs
"
:
searchbar_inputs
,
"
searchbar_filters
"
:
searchbar_filters
,
"
page_breadcrumbs
"
:
"
Factures Surplus
"
,
}
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
templates/operation_templates_page.xml
Voir le fichier @
eb339a32
...
...
@@ -4,7 +4,7 @@
<xpath
expr=
"//li[@id='menu-contact']"
position=
"before"
>
<li
class=
"nav-item"
t-if=
"operation.is_surplus_active and
ope_invoices_surplus
"
t-if=
"operation.is_surplus_active and
(isProductor or isAdmin or isSuperAdmin)
"
>
<a
t-attf-href=
"/operation/#{slug(operation)}/invoices-surplus"
...
...
@@ -17,198 +17,21 @@
</template>
<!-- Operation Document template -->
<!-- TODO: reuse same template as for consumer invoices -->
<template
id=
'operation_invoice_surplus'
name=
"Operation Factures Surplus"
>
<t
t-set=
"body_classname"
t-value=
"'o_woperations_body'"
/>
<t
t-call=
"oacc_portal.layout_op"
>
<div
id=
"wrap"
t-attf-class=
"wrap mt-0"
>
<div
class=
"container mb-5"
>
<t
t-call=
"portal.portal_searchbar"
>
<t
t-set=
"title"
>
Mes factures surplus
</t>
<div
class=
"col-12 bg-white"
>
<h3
class=
"text-center mt-2 text-uppercase"
>
Mes Factures Surplus
</h3>
<t
t-if=
"invoices_surplus"
>
<t
t-set=
"invoices"
t-value=
"invoices_surplus"
/>
<t
t-call=
"oacc_portal_account.operation_invoice_table"
/>
</t>
<div
class=
"row mt-4"
>
<div
class=
"col-12 bg-white shadow"
>
<form
class=
"d-flex daterange-content pt-3"
t-att-action=
"'/operation/%s/invoices-surplus' % (slug(operation))"
method=
"get"
/>
<table
class=
"table mt-4"
t-if=
"invoices_surplus"
>
<thead>
<tr
class=
"active"
>
<th
/>
<th
/>
<th>
Numéro de facture
</th>
<th>
Date
</th>
<th>
Période
</th>
<th>
Acheteur
</th>
<th
class=
"text-center"
>
Montant
</th>
<th
class=
"text-center"
>
Statut
</th>
<th
/>
</tr>
</thead>
<tbody>
<tr
t-foreach=
"invoices_surplus"
t-as=
"invoice"
>
<td>
<a
t-att-href=
"invoice.get_portal_url(report_type='pdf', download=True)"
target=
"_blank"
title=
"Télécharger"
aria-label=
"Télécharger"
>
<i
class=
"fa fa-download"
/>
</a>
</td>
<td>
<a
t-att-href=
"invoice.get_portal_url()"
target=
"_blank"
title=
"Visualiser"
aria-label=
"Visualiser"
>
<i
class=
"fa fa-eye"
/>
</a>
</td>
<td
class=
"fw-bolder"
>
<a
t-att-href=
"invoice.get_portal_url()"
t-att-title=
"invoice.name"
target=
"_blank"
>
<t
t-esc=
"invoice.name"
t-if=
"invoice.name != '/'"
/>
<em
t-elif=
"invoice.state == 'draft'"
>
Facture Brouillon
</em>
<em
t-else=
"invoice.state == 'cancel'"
>
Facture Annulée
</em>
</a>
</td>
<td
style=
"width: 120px;"
><t
t-out=
"invoice.invoice_date"
t-options=
"{'widget': 'date', 'format': 'dd-MM-YYYY'}"
/></td>
<td><t
t-out=
"invoice.start_date"
t-options=
"{'widget': 'date', 'format': 'dd-MM-YYYY'}"
/>
au
<t
t-out=
"invoice.end_date"
t-options=
"{'widget': 'date', 'format': 'dd-MM-YYYY'}"
/></td>
<td><t
t-out=
"invoice.partner_id.name"
/></td>
<td
class=
"text-end"
><t
t-out=
"invoice.amount_total_signed"
t-options=
"{"widget": "monetary", "display_currency": invoice.currency_id}"
/>
TTC
</td>
<td
class=
"tx_status text-center"
>
<t
t-if=
"invoice.state == 'draft'"
>
<span
class=
"badge rounded-pill text-bg-info"
><i
class=
"fa fa-fw fa-square-o"
aria-label=
"Brouillon"
title=
"Brouillon"
role=
"img"
/><span
class=
"d-none d-md-inline"
>
Brouillon
</span></span>
</t>
<t
t-if=
"invoice.state == 'posted' and invoice.payment_state not in ('in_payment', 'paid', 'reversed')"
>
<span
class=
"badge rounded-pill text-bg-warning"
aria-label=
"En paiement"
title=
"Lorsque le producteur recevra votre paiement, il devra manuellement marquer la facture comme payée, le statut passera alors à Payée."
><i
class=
"fa fa-fw fa-clock-o"
role=
"img"
/><span
class=
"d-none d-md-inline"
>
En paiement
</span></span>
</t>
<t
t-if=
"invoice.state == 'posted' and invoice.payment_state in ('paid', 'in_payment')"
>
<span
class=
"badge rounded-pill text-bg-success"
><i
class=
"fa fa-fw fa-check-square-o"
aria-label=
"Payée"
title=
"Payée"
role=
"img"
/><span
class=
"d-none d-md-inline"
>
Payée
</span></span>
</t>
<t
t-if=
"invoice.state == 'posted' and invoice.payment_state == 'reversed'"
>
<span
class=
"badge rounded-pill text-bg-success"
><i
class=
"fa fa-fw fa-check-square-o"
aria-label=
"Extournée"
title=
"Extournée"
role=
"img"
/><span
class=
"d-none d-md-inline"
>
Extournée
</span></span>
</t>
</td>
<td
class=
"text-center"
t-if=
"(isProductor or isAdmin or isSuperAdmin) and invoice.state == 'draft'"
>
<a
title=
"Valider la facture"
aria-label=
"Valider la facture"
t-att-href=
"'/my/invoices/%s/post?from_list=invoices-surplus' % invoice.id"
class=
"btn btn-sm btn-primary"
role=
"button"
>
<i
class=
"fa fa-check"
/>
<span
class=
"d-none d-md-inline"
>
Valider
</span>
</a>
</td>
<td
class=
"text-center"
t-elif=
"(isProductor or isAdmin or isSuperAdmin) and invoice.state == 'posted' and invoice.payment_state in ('not_paid', 'partial') and invoice.amount_total and invoice.move_type == 'out_invoice'"
>
<a
t-att-href=
"'/my/invoices/%s/pay?from_list=invoices-surplus' % invoice.id"
aria-label=
"Marquer la facture comme payée"
class=
"btn btn-sm btn-primary"
role=
"button"
title=
"Lorsque vous recevez le paiement du consommateur, cliquez sur ce bouton pour marquer le facture comme payée."
>
<i
class=
"fa fa-credit-card"
/>
<span
class=
"d-none d-md-inline"
>
Marquer comme payée
</span>
</a>
</td>
<td
t-else=
""
/>
</tr>
</tbody>
</table>
<t
t-else=
""
>
<p
t-else=
""
style=
"padding-top: 10px;"
class=
"pt-5"
>
Il n'y a actuellement aucune facture de surplus sur cette opération.
</p>
</div>
</div>
</div>
</t>
</div>
</t>
</template>
...
...
Ce diff est replié.
Cliquez pour l'agrandir.