Merge pull request #33300 from ssiyad/fix/pos/var_typo
fix(pos): variable typo: `s_pos` -> `is_pos`
diff --git a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py
index e93fb61..d269e1f 100644
--- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py
+++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py
@@ -533,12 +533,13 @@
],
filters={"company": company, "root_type": root_type},
):
- if account.account_name not in added_accounts:
+ if account.account_number:
+ account_key = account.account_number + "-" + account.account_name
+ else:
+ account_key = account.account_name
+
+ if account_key not in added_accounts:
accounts.append(account)
- if account.account_number:
- account_key = account.account_number + "-" + account.account_name
- else:
- account_key = account.account_name
added_accounts.append(account_key)
return accounts
diff --git a/erpnext/accounts/report/tax_detail/tax_detail.py b/erpnext/accounts/report/tax_detail/tax_detail.py
index ba8d307..ba733c2 100644
--- a/erpnext/accounts/report/tax_detail/tax_detail.py
+++ b/erpnext/accounts/report/tax_detail/tax_detail.py
@@ -234,8 +234,11 @@
if field in ["item_tax_rate", "base_net_amount"]:
return None
- if doctype == "GL Entry" and field in ["debit", "credit"]:
- column.update({"label": _("Amount"), "fieldname": "amount"})
+ if doctype == "GL Entry":
+ if field in ["debit", "credit"]:
+ column.update({"label": _("Amount"), "fieldname": "amount"})
+ elif field == "voucher_type":
+ column.update({"fieldtype": "Data", "options": ""})
if field == "taxes_and_charges":
column.update({"label": _("Taxes and Charges Template")})
diff --git a/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py b/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py
index 1e1b435..cdf1541 100644
--- a/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py
+++ b/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py
@@ -4,7 +4,7 @@
import frappe
from frappe import _
-from frappe.query_builder.functions import Floor, Sum
+from frappe.query_builder.functions import Sum
from pypika.terms import ExistsCriterion
@@ -58,9 +58,9 @@
bom_item.description,
bom_item.stock_qty,
bom_item.stock_uom,
- bom_item.stock_qty * qty_to_produce / bom.quantity,
- Sum(bin.actual_qty).as_("actual_qty"),
- Sum(Floor(bin.actual_qty / (bom_item.stock_qty * qty_to_produce / bom.quantity))),
+ (bom_item.stock_qty / bom.quantity) * qty_to_produce,
+ Sum(bin.actual_qty),
+ Sum(bin.actual_qty) / (bom_item.stock_qty / bom.quantity),
)
.where((bom_item.parent == filters.get("bom")) & (bom_item.parenttype == "BOM"))
.groupby(bom_item.item_code)
diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py
index 6f0b381..b151dd5 100644
--- a/erpnext/selling/doctype/quotation/test_quotation.py
+++ b/erpnext/selling/doctype/quotation/test_quotation.py
@@ -30,6 +30,24 @@
self.assertTrue(sales_order.get("payment_schedule"))
+ def test_maintain_rate_in_sales_cycle_is_enforced(self):
+ from erpnext.selling.doctype.quotation.quotation import make_sales_order
+
+ maintain_rate = frappe.db.get_single_value("Selling Settings", "maintain_same_sales_rate")
+ frappe.db.set_single_value("Selling Settings", "maintain_same_sales_rate", 1)
+
+ quotation = frappe.copy_doc(test_records[0])
+ quotation.transaction_date = nowdate()
+ quotation.valid_till = add_months(quotation.transaction_date, 1)
+ quotation.insert()
+ quotation.submit()
+
+ sales_order = make_sales_order(quotation.name)
+ sales_order.items[0].rate = 1
+ self.assertRaises(frappe.ValidationError, sales_order.save)
+
+ frappe.db.set_single_value("Selling Settings", "maintain_same_sales_rate", maintain_rate)
+
def test_make_sales_order_with_different_currency(self):
from erpnext.selling.doctype.quotation.quotation import make_sales_order
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 78e2370..0013c95 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -194,7 +194,7 @@
)
if cint(frappe.db.get_single_value("Selling Settings", "maintain_same_sales_rate")):
- self.validate_rate_with_reference_doc([["Quotation", "prev_docname", "quotation_item"]])
+ self.validate_rate_with_reference_doc([["Quotation", "prevdoc_docname", "quotation_item"]])
def update_enquiry_status(self, prevdoc, flag):
enq = frappe.db.sql(
diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
index ace2e29..5c4b578 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
+++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
@@ -12,7 +12,10 @@
"Auto Repeat": "reference_document",
"Maintenance Visit": "prevdoc_docname",
},
- "internal_links": {"Quotation": ["items", "prevdoc_docname"]},
+ "internal_links": {
+ "Quotation": ["items", "prevdoc_docname"],
+ "Material Request": ["items", "material_request"],
+ },
"transactions": [
{
"label": _("Fulfillment"),