Odoo Help

Welcome!

This community 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.

0

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

By
Nicholas Hamilton
on 7/8/14, 2:52 AM 1,905 views

Hi Guys,

From this post:

https://www.odoo.com/forum/Help-1/question/How-to-show-only-Tax-Name-on-Invoices-44564

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

Regards,

 

0
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?

Ludo - Neobis
on 7/8/14, 4:15 AM

I don't think that I can

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

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
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')]

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/8/14, 2:52 AM
Seen: 1905 times
Last updated: 3/16/15, 8:10 AM