Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3934 มุมมอง

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?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 24
1492
Sale Order Line Form Popup Odoo 14 แก้ไขแล้ว
1
ก.พ. 22
4862
Option Duplicate in DropDown More แก้ไขแล้ว
2
พ.ค. 19
3882
3
ส.ค. 18
5055
8
ก.พ. 16
11354