Odoo Help


Add insurance cost to sales order

Thomas Straetmans
on 7/28/15, 9:03 AM 749 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. 


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):

_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?

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

1 follower(s)


Asked: 7/28/15, 9:03 AM
Seen: 749 times
Last updated: 7/28/15, 10:08 AM