|
def onchange_order_line(self): |
The none type of discount should set the discount amount and discount percentage to zero.
def onchange_discount(self):
amount_total = self.amount_untaxed + self.amount_tax
if self.chargeable_amount:
if self.discount_type == 'none' and self.chargeable_amount:
self.discount_type = 'fixed'
discount = amount_total - self.chargeable_amount
self.discount_percentage = (discount / amount_total) * 100
else:
if self.discount_type == 'none':
self.discount_percentage = 0
self.discount = 0
if self.discount:
self.discount_percentage = (self.discount / amount_total) * 100
if self.discount_percentage:
self.discount = amount_total * self.discount_percentage / 100
odoo-modules/bahmni_sale/models/sale_order.py
Line 113 in 37ff23e
The none type of discount should set the discount amount and discount percentage to zero.