diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index fcf3ad6ca145ffb45ad1a8d0b71559af6ab034b5..51af04b2c98fa04c8b59f4fbeefa369ec1920c58 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 c1f1124b5b727bf1fd6a2055270fe45c84a46816..a3277b540b61419af41118c874a1517421558556 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)