Odoo Help


How can we set tax % to a partner? [Closed]

on 5/1/13, 8:27 AM 2,686 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 07/19/2013 02:21:37

image description

How can i change the balance amount? I trie to edit the code,but no change.

image description

Payment also not changing. I tried to edit account_voucher, but no difference.

Is it possible to define tax & discount amount to a particular customer in openerp7. 0?


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 5/1/13, 9:11 AM

So what is the issue? Just override _amount_all method in your module and in that method fetch discount and tax of selected customer and then deduct the total amount.

To override method of functional field in your module, you have to override those fields as well in your module. In that method fetch tax & discount from selected customer and then deduct tax, discount from total amount of sale order line.

I'm totally confused with the requirement. Requirement::I added two products in sales order for a customer without tax & discount. I want to add 5% tax & 30 % discount in customer form.So that when i select the customer automatically tax&discount selects in the sale order. Then total will according to all these. Eg: product1+product2:1000, discount for the customer is:30% then it will be 700. But tax for the customer is 5% then total be 750. I want to set tax & discount for each customer.

on 5/1/13, 9:24 AM

You cannot perform amount calculation in onchange method because first you will select customer and then you will select sale order line. So calculation is not possible in onchange. You have to override _amount_all along with field also in your module.

Sudhir Arya (ERP Harbor Consulting Services)
on 5/1/13, 9:29 AM

Agree with Arya.

AB Consultant
on 5/1/13, 9:30 AM

How can i implement from the starting? Please assist me. Thanks.

on 5/1/13, 9:34 AM

See my updated answer.

Sudhir Arya (ERP Harbor Consulting Services)
on 5/1/13, 10:20 AM

Hi Sudhir, i just override the _amount_all. What are fields related to this? From where should i delete this?

on 5/2/13, 2:10 AM

There are three functional fields which are using _amount_all method. 1. amount_untaxed, 2.amount_tax, 3. amount_total. You have to overwrite this three fields in your module as well along with _amount_all method. And write your calculation logic inside that method.

Sudhir Arya (ERP Harbor Consulting Services)
on 5/2/13, 2:16 AM

Thanks. Overwrite it from Sale module only?

on 5/2/13, 2:20 AM

Yes. Just copy paste those fields in your own module.

Sudhir Arya (ERP Harbor Consulting Services)
on 5/2/13, 2:21 AM

Sorry Sudhir, I couldn't get you. Shall i want to create a new custom module for this requirement?

on 5/2/13, 2:28 AM

So you are not creating any custom module and you are changing addons directly? Am I right?

Sudhir Arya (ERP Harbor Consulting Services)
on 5/2/13, 2:34 AM

Yes you are right, i just change the core module of sale.py

on 5/2/13, 2:38 AM

Then you just need to write your calculation logic in _amount_all method.

Sudhir Arya (ERP Harbor Consulting Services)
on 5/2/13, 2:41 AM

Did you know about "Customer privilege in sales order line?" can we hide/inaccesible confirm sale to customer?

on 5/2/13, 9:35 AM

Hi Sudhir, Customer Portal Service module to configure? I have almost configure it. but remaining is customer can make both order & confirm sale order. Customer can't give the permission to confirm sale.

on 5/6/13, 3:37 AM

@sudhir,please help me. I updated _amount_all function with your code. I want to add tax_amount in account_voucher model. But where i have to update it? Will it be the same code or ...?

on 7/31/13, 3:48 AM

@sudhir. Please go through with my updated question.

on 8/1/13, 7:20 AM



| 5 4 7
Baarn, Netherlands
On 5/1/13, 10:31 AM

It is possible to assign a default pricelist to a customer. On this pricelist, you specify the discount. So that part of your question is solved.

If you want to use a specific tax, you have to setup accounting> Part of the config is to create or specify which kind of bookkeeping you want to use (Dutch, German, etc). This will be taken into account when doing the calculation of the total for an order.

In order for the calculation to be correct, you have to specify as much as possible for a customer.

In The Netherlands, default tax = 21%, and if the customer is in The Netherlands, the tax of 21% will be calculated and added. If the customer is in the EU, and has a valid VAT, the tax is not calculated and added.

I hope this helps you a bit.

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/1/13, 8:27 AM
Seen: 2686 times
Last updated: 9/26/17, 12:17 AM