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.

5

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

By
Remya
on 5/1/13, 8:27 AM 2,113 views

The Question has been closed

by
Sudhir Arya (SA)
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?

2

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
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.

Remya
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 (SA)
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.

Remya
on 5/1/13, 9:34 AM

See my updated answer.

Sudhir Arya (SA)
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?

Remya
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 (SA)
on 5/2/13, 2:16 AM

Thanks. Overwrite it from Sale module only?

Remya
on 5/2/13, 2:20 AM

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

Sudhir Arya (SA)
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?

Remya
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 (SA)
on 5/2/13, 2:34 AM

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

Remya
on 5/2/13, 2:38 AM

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

Sudhir Arya (SA)
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?

Remya
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.

Remya
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 ...?

Remya
on 7/31/13, 3:48 AM

@sudhir. Please go through with my updated question.

Remya
on 8/1/13, 7:20 AM
0

patrick

--patrick--
1958
| 5 4 7
Baarn, Netherlands
--patrick--
patrick
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 5/1/13, 8:27 AM
Seen: 2113 times
Last updated: 3/16/15, 8:10 AM