diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index e6f80ab406677a3d1aa7a48be0eaf4d8f15418c3..3850c877d2823812e46931a491bb7bde3b83be7d 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -275,7 +275,7 @@ class SalesInvoice(SellingController): self.validate_auto_set_posting_time() self.validate_posting_datetime_chronology() - if not self.is_pos: + if not (self.is_pos or self.is_debit_note): self.so_dn_required() if cint(self.is_down_payment_invoice) and len([x.sales_order for x in self.get("items")]) > 1: diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 4484f608620e2c327308acdc210182d4fda252b1..3705b0728e4d4488e32a4a1b9aada2fed5afcb26 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -28,7 +28,8 @@ class SellingController(StockController): def validate(self): super(SellingController, self).validate() self.validate_items() - self.validate_max_discount() + if not self.get("is_debit_note"): + self.validate_max_discount() self.validate_selling_price() self.set_qty_as_per_stock_uom() self.set_po_nos(for_validate=True)