Odoo Help


How to show currency symbol instead of currency name in a treeview?

César Bustíos Benites
on 11/7/14, 12:46 PM 3,877 views

I didn't have enough karma yesterday to create a question here. Please, refer to my question on Stack Overflow:



Marvin Taboada
On 11/7/14, 9:35 PM

Hello César, I have read your question in SO and I think you can use Odoo Model/View inheritance (both of them) in a new custom module to fulfill your requirement.


* The Model related with Currencies ('res.currency') already provides the currency symbol you require to display.

* 'purchase.order' already has a direct (in v8.0) or indirect relationship (in v7.0) to 'res.currency'.

What to do then?

Add a new "related field" (OpenERP v7.0 terminology) to 'purchase.order' in order to reuse its relationship with 'res.currency' to have the currency symbol available from the 'purchase.order' model.

* Odoo's "class inheritance" (also referred as classical inheritance) for Models allows you to extend an existing model (add new fields, override methods, etc.)

* Odoo's "view inheritance" allows you to redefine existing views.

As you may have already read, Model/View inheritance, in new custom modules, is the preferred way of customizing existing modules.

Sample sources for Odoo 8.0 (an hipotetical 'purchase_currency_symbol' module)


import purchase_currency_symbol


    'name': "Purchase Order Currency as Symbol",
    'version': "1.0",
    'category': "Purchase Management",
    'summary': 'Purchase Order Currency as Symbol',
    'description': """
Purchase Order Currency as Symbol

Purchase Order Currency as Symbol.
    'author': "Foo",
    'website': 'http://www.example.org',
    'depends': ['purchase'],
    'data': [
    'installable': True,
    'auto_install': False,
    'application': False,


<?xml version="1.0" encoding="utf-8"?>

        <record id="purchase_order_form_inherited" model="ir.ui.view">
            <field name="name">purchase.order.form.inherited</field>
            <field name="model">purchase.order</field>
            <field name="inherit_id" ref="purchase.purchase_order_form"/>
            <field name="arch" type="xml">
                    <field name="currency_id" position="replace">
                        <field name="currency_symbol" groups="base.group_multi_currency"/>

        <record id="purchase_order_tree_inherited" model="ir.ui.view">
            <field name="name">purchase.order.tree.inherited</field>
            <field name="model">purchase.order</field>
            <field name="inherit_id" ref="purchase.purchase_order_tree"/>
            <field name="arch" type="xml">
                    <field name="origin" position="after">
                        <field name="currency_symbol" groups="base.group_multi_currency"/>



from openerp import models, fields

class PurchaseOrder(models.Model):

    _name = "purchase.order"
    _inherit = "purchase.order"

    currency_symbol = fields.Char(string='Currency',

Below sources are for Odoo 8.0, you can adapt the Model in case you're using OpenERP 7.0.

For any doubts, review the official developer oriented documentation at:

* OpenERP 7.0 (Technical Memento)

* Odoo 8.0



Thank you Marvin!

César Bustíos Benites
on 11/12/14, 11:49 AM

Hi,actually its working but where its reflect in our UI.Looking for your reply

on 11/14/15, 9:03 AM



| 5 3 6
Jakarta, Indonesia
On 11/7/14, 10:05 PM

César, do you want the Currency to show as Currency Symbol everywhere or just in the PO?  If you want to show Symbol only in PO, then you can create a related field to get the symbol from currency_id as Marvin as pointed out.  If you want to show Symbol to replace the name everywhere, you have 2 options: 1. override the _rec_name attribute in res.currency.  You can seach for the attribute's name in addons folder to find examples. 2. override the name_get method if res.currency.  The name_get method in the original res.currency model provides some clue (file openerp/addons/base/res/res_currency.py).  In principle, the string that will be display in many2one fields will be dependent on _rec_name attribute, which should be the column name you wish to be displayed (default is the column named "name").  Then it can be altered through the name_get method.

Good point John!

Marvin Taboada
on 11/7/14, 10:35 PM

Thank you that was helpful!

César Bustíos Benites
on 11/12/14, 11:49 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/7/14, 12:46 PM
Seen: 3877 times
Last updated: 3/16/15, 8:10 AM