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

how to get amount of tax

By
oussama
on 10/9/14, 10:41 AM 562 views

Hi

how to get amount of tax in  selection

my file .py:

 def _get_tva_p(self,cr,uid,ids,name,arg,context=None):
        obj=self.pool.get('account.tax')  
        for tax in obj.browse(self,cr,uid,ids,context):
            return ((tax.amount,tax.amount))

'tva_p': fields.function(_get_tva_p,method=True, type='selection', string="Tva en pourcentage",store=True),

 

thanks

0
Sairam Bandaru
On 10/9/14, 11:16 AM

Hi 

You can try like this

def _get_tva_p(self,cr,uid,ids,name,arg,context=None):
        obj=self.pool.get('account.tax')  
        tax_list = []

        for tax in obj.browse(self,cr,uid,ids,context):

            tax_list.append((tax.amount,tax.amount))
        return tax_list

'tva_p': fields.function(_get_tva_p,method=True, type='selection', string="Tva en pourcentage",store=True),

Thank for your response but it not working

oussama
on 10/9/14, 11:32 AM

Modification: 'tva_p': fields.function(_get_tva_p,method=True, type='selection', string="Tva en pourcentage"), you have to remove store= True then only fuinction get call every time

sairam
on 5/28/15, 2:34 AM

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: 10/9/14, 10:41 AM
Seen: 562 times
Last updated: 3/16/15, 8:10 AM