Skip to content

Commit 0cc7727

Browse files
authored
Merge pull request #54101 from frappe/version-15-hotfix
2 parents 2597eaa + 5b7e6eb commit 0cc7727

62 files changed

Lines changed: 1975 additions & 631 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def add_vouchers(gl_account="_Test Bank - _TC"):
398398
frappe.get_doc(
399399
{
400400
"doctype": "Customer",
401-
"customer_group": "All Customer Groups",
401+
"customer_group": "Individual",
402402
"customer_type": "Company",
403403
"customer_name": "Poore Simon's",
404404
}
@@ -429,7 +429,7 @@ def add_vouchers(gl_account="_Test Bank - _TC"):
429429
frappe.get_doc(
430430
{
431431
"doctype": "Customer",
432-
"customer_group": "All Customer Groups",
432+
"customer_group": "Individual",
433433
"customer_type": "Company",
434434
"customer_name": "Fayva",
435435
}

erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def make_customer(customer=None):
209209
{
210210
"doctype": "Customer",
211211
"customer_name": customer_name,
212-
"customer_group": "All Customer Groups",
212+
"customer_group": "Individual",
213213
"customer_type": "Company",
214214
"territory": "All Territories",
215215
}

erpnext/accounts/doctype/payment_entry/payment_entry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ frappe.ui.form.on("Payment Entry", {
839839
paid_amount: function (frm) {
840840
frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
841841
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
842-
if (!frm.doc.received_amount) {
842+
if (frm.doc.paid_amount) {
843843
if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
844844
frm.set_value("received_amount", frm.doc.paid_amount);
845845
} else if (company_currency == frm.doc.paid_to_account_currency) {
@@ -860,7 +860,7 @@ frappe.ui.form.on("Payment Entry", {
860860
flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate)
861861
);
862862

863-
if (!frm.doc.paid_amount) {
863+
if (frm.doc.received_amount) {
864864
if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
865865
frm.set_value("paid_amount", frm.doc.received_amount);
866866
if (frm.doc.target_exchange_rate) {

erpnext/accounts/doctype/payment_entry/test_payment_entry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,7 @@ def create_customer(name="_Test Customer 2 USD", currency="USD"):
20432043
customer.customer_name = name
20442044
customer.default_currency = currency
20452045
customer.type = "Individual"
2046+
customer.customer_group = "Individual"
20462047
customer.save()
20472048
customer = customer.name
20482049
return customer

erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def create_customer(self):
8080
customer = frappe.new_doc("Customer")
8181
customer.customer_name = name
8282
customer.type = "Individual"
83+
customer.customer_group = "Individual"
8384
customer.save()
8485
self.customer = customer.name
8586

erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,6 +2546,7 @@ def make_customer(customer_name, currency=None):
25462546
customer = frappe.new_doc("Customer")
25472547
customer.customer_name = customer_name
25482548
customer.type = "Individual"
2549+
customer.customer_group = "Individual"
25492550

25502551
if currency:
25512552
customer.default_currency = currency

erpnext/accounts/doctype/promotional_scheme/promotional_scheme.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ frappe.ui.form.on("Promotional Scheme", {
2121

2222
selling: function (frm) {
2323
frm.trigger("set_options_for_applicable_for");
24+
frm.toggle_enable("buying", !frm.doc.selling);
2425
},
2526

2627
buying: function (frm) {
2728
frm.trigger("set_options_for_applicable_for");
29+
frm.toggle_enable("selling", !frm.doc.buying);
2830
},
2931

3032
set_options_for_applicable_for: function (frm) {

erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,10 @@ def make_item_gl_entries(self, gl_entries):
978978
if provisional_accounting_for_non_stock_items:
979979
self.get_provisional_accounts()
980980

981+
adjust_incoming_rate = frappe.db.get_single_value(
982+
"Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate"
983+
)
984+
981985
for item in self.get("items"):
982986
if flt(item.base_net_amount) or (self.get("update_stock") and item.valuation_rate):
983987
if item.item_code:
@@ -1146,7 +1150,11 @@ def make_item_gl_entries(self, gl_entries):
11461150
)
11471151

11481152
# check if the exchange rate has changed
1149-
if item.get("purchase_receipt") and self.auto_accounting_for_stock:
1153+
if (
1154+
not adjust_incoming_rate
1155+
and item.get("purchase_receipt")
1156+
and self.auto_accounting_for_stock
1157+
):
11501158
if (
11511159
exchange_rate_map[item.purchase_receipt]
11521160
and self.conversion_rate != exchange_rate_map[item.purchase_receipt]
@@ -1183,6 +1191,7 @@ def make_item_gl_entries(self, gl_entries):
11831191
item=item,
11841192
)
11851193
)
1194+
11861195
if (
11871196
self.auto_accounting_for_stock
11881197
and self.is_opening == "No"

erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,12 @@ def test_purchase_invoice_with_exchange_rate_difference(self):
356356
make_purchase_invoice as create_purchase_invoice,
357357
)
358358

359+
original_value = frappe.db.get_single_value(
360+
"Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate"
361+
)
362+
363+
frappe.db.set_single_value("Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", 0)
364+
359365
pr = make_purchase_receipt(
360366
company="_Test Company with perpetual inventory",
361367
warehouse="Stores - TCP1",
@@ -376,12 +382,17 @@ def test_purchase_invoice_with_exchange_rate_difference(self):
376382
amount = frappe.db.get_value(
377383
"GL Entry", {"account": exchange_gain_loss_account, "voucher_no": pi.name}, "debit"
378384
)
385+
379386
discrepancy_caused_by_exchange_rate_diff = abs(
380387
pi.items[0].base_net_amount - pr.items[0].base_net_amount
381388
)
382389

383390
self.assertEqual(discrepancy_caused_by_exchange_rate_diff, amount)
384391

392+
frappe.db.set_single_value(
393+
"Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", original_value
394+
)
395+
385396
def test_purchase_invoice_with_exchange_rate_difference_for_non_stock_item(self):
386397
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import (
387398
make_purchase_invoice as create_purchase_invoice,

erpnext/accounts/doctype/sales_invoice/sales_invoice.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,7 @@
777777
},
778778
{
779779
"collapsible": 1,
780-
"collapsible_depends_on": "eval:doc.total_billing_amount > 0",
781-
"depends_on": "eval:!doc.is_return",
780+
"collapsible_depends_on": "eval:doc.total_billing_amount > 0 || doc.total_billing_hours > 0",
782781
"fieldname": "time_sheet_list",
783782
"fieldtype": "Section Break",
784783
"hide_border": 1,
@@ -792,7 +791,6 @@
792791
"hide_days": 1,
793792
"hide_seconds": 1,
794793
"label": "Time Sheets",
795-
"no_copy": 1,
796794
"options": "Sales Invoice Timesheet",
797795
"print_hide": 1
798796
},
@@ -2112,7 +2110,7 @@
21122110
"fieldtype": "Column Break"
21132111
},
21142112
{
2115-
"depends_on": "eval:(!doc.is_return && doc.total_billing_amount > 0)",
2113+
"depends_on": "eval:doc.total_billing_amount > 0 || doc.total_billing_hours > 0",
21162114
"fieldname": "section_break_104",
21172115
"fieldtype": "Section Break"
21182116
},
@@ -2200,7 +2198,7 @@
22002198
"link_fieldname": "consolidated_invoice"
22012199
}
22022200
],
2203-
"modified": "2026-02-05 20:43:44.732805",
2201+
"modified": "2026-04-06 22:30:28.513139",
22042202
"modified_by": "Administrator",
22052203
"module": "Accounts",
22062204
"name": "Sales Invoice",

0 commit comments

Comments
 (0)