mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-15 09:53:09 +00:00
fix: remove incorrect report conditions and unset sales partner on consolidated sales invoice (#48669)
* fix: undo query changes for sales partner related reports * fix: patch to remove sales partner from consolidated sales invoice
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
SalesInvoice = frappe.qb.DocType("Sales Invoice")
|
||||
|
||||
query = (
|
||||
frappe.qb.update(SalesInvoice)
|
||||
.set(SalesInvoice.sales_partner, "")
|
||||
.set(SalesInvoice.commission_rate, 0)
|
||||
.set(SalesInvoice.total_commission, 0)
|
||||
.where(SalesInvoice.is_consolidated == 1)
|
||||
)
|
||||
|
||||
# For develop/version-16
|
||||
if frappe.db.has_column("Sales Invoice", "is_created_using_pos"):
|
||||
query = query.where(SalesInvoice.is_created_using_pos == 0)
|
||||
|
||||
query.run()
|
||||
Reference in New Issue
Block a user