Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
6887 Zobrazení

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,

 

Avatar
Zrušit
Nejlepší odpověď

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

 

Avatar
Zrušit
Autor Nejlepší odpověď

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?

Avatar
Zrušit

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?

Autor

I don't think that I can