Implement user-facing invoice listings #470

Merged
tobru merged 6 commits from 196-invoice-listing into main 2026-03-31 06:43:43 +00:00
Member

This PR provides an invoice listing page showing a list of all available invoices and their status. If an invoice is unpaid, a "Pay" button redirects users to the Odoo payment page. Availability of invoice listings is configurable per Origin.

Open questions

  • Who should be able to see the invoice listing page? The issue did not specify; I limited it to Owner/Admin level users, so that regular Member-level users cannot access it
  • The invoice listing page is not paginated – I expect this to be fine for a pretty long time, but we can switch to a paginated view immediately if you prefer.
  • Odoo caching - invoices are fetched live on each page load. We can add caching now or later when/if performance becomes a conce
  • invoice_listing_message accepts HTML in order to be able to contain links to the e.g. Exoscale invoice page. Is HTML ok here or would you prefer the link to be configured separately, or to use Markdown?
This PR provides an invoice listing page showing a list of all available invoices and their status. If an invoice is unpaid, a "Pay" button redirects users to the Odoo payment page. Availability of invoice listings is configurable per Origin. ### Open questions - Who should be able to see the invoice listing page? The issue did not specify; I limited it to Owner/Admin level users, so that regular Member-level users cannot access it - The invoice listing page is not paginated – I expect this to be fine for a pretty long time, but we can switch to a paginated view immediately if you prefer. - Odoo caching - invoices are fetched live on each page load. We can add caching now or later when/if performance becomes a conce - invoice_listing_message accepts HTML in order to be able to contain links to the e.g. Exoscale invoice page. Is HTML ok here or would you prefer the link to be configured separately, or to use Markdown?
Implement user-facing invoice listings
All checks were successful
Tests / test (push) Successful in 56s
fbecdf89d9
Improve message and permission handling
All checks were successful
Tests / test (push) Successful in 56s
125a7a093a
Owner

Who should be able to see the invoice listing page? The issue did not specify; I limited it to Owner/Admin level users, so that regular Member-level users cannot access it

This is good for now. Maybe at one point we'll introduce a "Billing" role (or similar) which only has access to invoices

The invoice listing page is not paginated – I expect this to be fine for a pretty long time, but we can switch to a paginated view immediately if you prefer.

Fine for now

Odoo caching - invoices are fetched live on each page load. We can add caching now or later when/if performance becomes a conce

Good to know, we'll figure out in practice if it's needed or not

invoice_listing_message accepts HTML in order to be able to contain links to the e.g. Exoscale invoice page. Is HTML ok here or would you prefer the link to be configured separately, or to use Markdown?

That's perfect

> Who should be able to see the invoice listing page? The issue did not specify; I limited it to Owner/Admin level users, so that regular Member-level users cannot access it This is good for now. Maybe at one point we'll introduce a "Billing" role (or similar) which only has access to invoices > The invoice listing page is not paginated – I expect this to be fine for a pretty long time, but we can switch to a paginated view immediately if you prefer. Fine for now > Odoo caching - invoices are fetched live on each page load. We can add caching now or later when/if performance becomes a conce Good to know, we'll figure out in practice if it's needed or not > invoice_listing_message accepts HTML in order to be able to contain links to the e.g. Exoscale invoice page. Is HTML ok here or would you prefer the link to be configured separately, or to use Markdown? That's perfect
@ -0,0 +25,4 @@
<tbody>
{% for invoice in invoices %}
<tr>
<td>{{ invoice.name }}</td>
Owner

Add the same link {{ invoice.payment_url }} here, independent if paid or not. This allows to access the invoice in the Odoo portal anytime.

Add the same link `{{ invoice.payment_url }}` here, independent if paid or not. This allows to access the invoice in the Odoo portal anytime.
rixx marked this conversation as resolved
@ -0,0 +46,4 @@
<td>{{ invoice.amount_residual|floatformat:2 }} {{ invoice.currency }}</td>
<td>
{% if invoice.payment_url %}
<a href="{{ invoice.payment_url }}"
Owner

This resolves to an URL like http://127.0.0.1:8000/my/invoices/34039?access_token=UUID, but it should resolve to $SERVALA_ODOO_URL/my/invoices/34039?access_token=UUID

This resolves to an URL like `http://127.0.0.1:8000/my/invoices/34039?access_token=UUID`, but it should resolve to `$SERVALA_ODOO_URL/my/invoices/34039?access_token=UUID`
rixx marked this conversation as resolved
@ -17,6 +17,15 @@
{% translate 'Organization' %}</span>
</a>
</li>
{% if request.user_role == "admin" or request.user_role == "owner" or request.user.is_staff %}
Owner

The menu should also be hidden when show_invoice_listing is False.

The menu should also be hidden when `show_invoice_listing` is False.
rixx marked this conversation as resolved
Author
Member

Fixed the three issues and also made it so that the "Pay" button does not show up for paid invoices (oops).

Fixed the three issues and also made it so that the "Pay" button does not show up for paid invoices (oops).
show amount total instead of residual
All checks were successful
Tests / test (push) Successful in 41s
188773d84d
move invoices into a submenu of organization
All checks were successful
Tests / test (push) Successful in 41s
fec3088c04
tobru merged commit 805d6c5d99 into main 2026-03-31 06:43:43 +00:00
tobru deleted branch 196-invoice-listing 2026-03-31 06:43:43 +00:00
Sign in to join this conversation.
No description provided.