This question has been flagged
2883 Views

I set sales and purchase tax in `Accounting -> Settings`.

I need to fetch these records in python function. I write a function in `account.config.settings` model. But it returns None.

*.py

    @api.model

    def get_sale_tax(self):

           ir_values = self.env['ir.values']

           taxes_id = ir_values.get_default('product.template', 'taxes_id', company_id = self.company_id.id)

           print'sales tax',taxes_id //Print None

           return taxes_id

And

@api.model

    def get_sale_tax(self):

           return [self.default_sale_tax_id.amount]


How can i do it? Any solution?


Avatar
Discard