-
-
Notifications
You must be signed in to change notification settings - Fork 313
/
Copy pathsale.py
23 lines (19 loc) · 897 Bytes
/
sale.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# © 2016-2017 Akretion (Alexis de Lattre <[email protected]>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, models
class SaleOrder(models.Model):
_inherit = "sale.order"
def _compute_display_name(self):
"""Add amount_untaxed in name_get of sale orders"""
res = super()._compute_display_name()
if self._context.get("sale_order_show_amount"):
for order in self:
# TODO: find a python method to easily display a float + currency
# symbol (before or after) depending on lang of context and currency
name = _(
" Amount w/o tax: %(amount)s %(currency)s",
amount=order.amount_untaxed,
currency=order.currency_id.name,
)
order.display_name = name
return res