diff --git a/bahmni_sale/models/sale_order_line.py b/bahmni_sale/models/sale_order_line.py index 8a54180..2eafa70 100644 --- a/bahmni_sale/models/sale_order_line.py +++ b/bahmni_sale/models/sale_order_line.py @@ -40,14 +40,8 @@ def onchange_product_uom_qty(self): @api.onchange('lot_id') def onchange_lot_id(self): if self.lot_id: - self.expiry_date = self.lot_id.expiration_date - res_config = self.env['res.config.settings'].search([],order='id desc',limit=1) - - print("res_config",res_config.id) - print("res_config",res_config.sale_price_markup) - - - if res_config.sale_price_markup == True: + self.expiry_date = self.lot_id.expiration_date + if if bool(self.env['ir.config_parameter'].sudo().get_param('bahmni_sale.sale_price_markup')) == True: self.price_unit = self.lot_id.sale_price if self.lot_id.sale_price > 0.0 else self.product_id.lst_price else: self.price_unit = self.product_id.lst_price