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

Tax Calculation in Sales Module(Sales.Order.Line )

By
Tharanga Jayasinghe
on 10/25/16, 12:51 PM 186 views

Hai All,

I'm trying to calculate sales order line tax by using below code

taxes = line.tax_id.compute_all(price, line.order_id.currency_id, line.product_uom_qty, product=line.product_id, partner=line.order_id.partner_id)


I received below out put on debugging that code

{'base': 750.75, 'taxes': [{'account_id': False,            'amount': 16.67,            'analytic': False,            'base': 833.33,            'id': 3,            'name': u'NBT 2 %',            'refund_account_id': False,            'sequence': 1},           {'account_id': False,            'amount': 82.58,            'analytic': False,            'base': 750.75,            'id': 4,            'name': u'VAT 11%',            'refund_account_id': False,            'sequence': 1}], 'total_excluded': 750.75, 'total_included': 850.0}


Please explain me

  • where is the definition for compute_all () function?
  • Where is the location of this function is implemented?
  • In which type Model fields I can use that function.ex -: line.tax_id == manytomany data type


hello Ahamed,

Great job.Thanks a lot


Tharanga Jayasinghe
on 10/26/16, 5:18 AM
1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 10/26/16, 2:31 AM

Hello,

This function defined here ... and you can read about the implementation in the doc string of the function ..


Hope this could helps ..

hello Ahamed,

Great job.Thanks a lot

Tharanga Jayasinghe
on 10/26/16, 7:05 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/25/16, 12:51 PM
Seen: 186 times
Last updated: 10/26/16, 5:34 AM