Odoo Help


Change default 'name' value in account.invoice.tax object

Nicholas Hamilton
on 7/8/14, 2:52 AM 2,616 views

Hi Guys,

From this post:


The first answer states this:


Invoice Reports Tax detail 'Tax code - Tax Name' it is default functionality in Openerp 7.


I Would like to change the default from 'Tax code - Tax Name', to simply 'Tax Name', however, I cannot work out how to make this change.

In fact, I have added a custom field to the 'account.tax' object, called x_description_short, which I would prefer to use instead, however, if someone can point me in the direction of HOW to change the default value, I should be able to work out the rest.

To clarify, I am running openerp online via odoo.com



Nicholas Hamilton
On 7/8/14, 3:52 AM

Ludo, it seems that I cannot comment directly to your post, probably due to lack of 'reputation' or something like that. Thanks for your answer, however, how can I apply that change on the odoo.com online service?

Ow, I see. I totally missed that part. I do not know if you are allowed to create custom modules on the online service. If that would be the case, create a small module that does just that. If not, I think you will have no luck with my suggested method. Maybe someone else has another idea?

21south, Ludo - 21South
on 7/8/14, 4:15 AM

I don't think that I can

Nicholas Hamilton
on 7/8/14, 5:04 AM

Ludo - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
On 7/8/14, 3:29 AM

When inheriting account.tax, you can overwrite the "name_get" method. You can use that method to make Odoo return a custom value for each time the record appears somewhere on a list or form. 

Note: This is system-wide, so ALL the occurences of account.tax will use this method to determine the display-name.


This is an example as found in the standard account module:


    def name_get(self, cr, uid, ids, context=None):
        if not ids:
            return []
        types = {
                'out_invoice': _('Invoice'),
                'in_invoice': _('Supplier Invoice'),
                'out_refund': _('Refund'),
                'in_refund': _('Supplier Refund'),
        return [(r['id'], '%s %s' % (r['number'] or types[r['type']], r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]


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: 7/8/14, 2:52 AM
Seen: 2616 times
Last updated: 3/16/15, 8:10 AM