Skip to content

Commit

Permalink
Merge PR #515 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by carmenbianca
  • Loading branch information
github-grap-bot committed May 30, 2023
2 parents f3447bc + 85aca39 commit 37de8db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
10 changes: 3 additions & 7 deletions portal_pos_order_amount/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from itertools import groupby

from odoo.http import request
from odoo.tools import float_repr

from odoo.addons.portal.controllers.portal import CustomerPortal

Expand All @@ -28,15 +27,12 @@ def _prepare_portal_layout_values(self):
]
)
)
values["pos_order_amount"] = float_repr(
sum(po.amount_total for po in owned_pos_order), 2
)
values["pos_order_amount"] = sum(po.amount_total for po in owned_pos_order)
values["pos_order_amount_by_year"] = [
{
"year": year,
"amount": float_repr(
sum(pos_order.amount_total for pos_order in grouped_pos_orders),
2,
"amount": sum(
pos_order.amount_total for pos_order in grouped_pos_orders
),
}
for year, grouped_pos_orders in groupby(
Expand Down
7 changes: 3 additions & 4 deletions portal_pos_order_amount/templates/portal_pos_order_amount.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
You have purchased a total amount of
<span
t-esc="pos_order_amount"
t-esc-options='{"widget": "monetary", "display_currency": "company_currency"}'
/>
.
t-options='{"widget": "monetary", "display_currency": company_currency}'
/>.
</p>
<table name="pos_order_amount_by_year" class="table table-striped">
<tr>
Expand All @@ -40,7 +39,7 @@
<td>
<t
t-esc="row['amount']"
t-esc-options='{"widget": "monetary", "display_currency": "company_currency"}'
t-options='{"widget": "monetary", "display_currency": company_currency}'
/>
</td>
</tr>
Expand Down

0 comments on commit 37de8db

Please sign in to comment.