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

Add insurance cost to sales order

By
Thomas Straetmans
on 7/28/15, 9:03 AM 420 views

In my module, when creating a sales order, you can choose to add an insurance. An insurance will then add a certain % to the total price (without taxes). Now i would like to show this added cost between the 'untaxed amount' and the 'taxes' on the sales order and then add it the to total amount.

I am pretty new to odoo and Python so any help on where and what I have to change in order to make this work would be great. 


Edit:

So i overwrote the def _amount_all from the sale.py file but I have a problem getting the insurance %.

My insurance is the following many2one field:


'xx_insurance_type': fields.many2one('xx.insurance.type', string='Insurance')

class InsuranceType(osv.Model):
_name='xx.insurance.type'

_columns = {
'name' : fields.char(size=128, string = 'Name'),
'sale_ids': fields.one2many('sale.order', 'xx_insurance_type', string = 'Sale orders'),
'insurance_percentage' : fields.float('Insurance cost in %')
}

So how can I get the 'insurance_percentage' float from the 'xx_insurance_type' field?

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: 7/28/15, 9:03 AM
Seen: 420 times
Last updated: 7/28/15, 10:08 AM