Merge pull request #47090 from frappe/version-14-hotfix

chore: release v14
This commit is contained in:
ruthra kumar
2025-04-16 09:31:20 +05:30
committed by GitHub
10 changed files with 82 additions and 21 deletions

View File

@@ -7,7 +7,7 @@ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from frappe.model.meta import get_field_precision from frappe.model.meta import get_field_precision
from frappe.model.naming import set_name_from_naming_options from frappe.model.naming import set_name_from_naming_options
from frappe.utils import flt, fmt_money from frappe.utils import flt, fmt_money, now
import erpnext import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -405,7 +405,7 @@ def rename_temporarily_named_docs(doctype):
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc) set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
newname = doc.name newname = doc.name
frappe.db.sql( frappe.db.sql(
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0 where name = %s", f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0, modified = %s where name = %s",
(newname, oldname), (newname, now(), oldname),
auto_commit=True, auto_commit=True,
) )

View File

@@ -350,15 +350,25 @@ class PaymentEntry(AccountsController):
self.set(self.party_account_field, party_account) self.set(self.party_account_field, party_account)
self.party_account = party_account self.party_account = party_account
if self.paid_from and not (self.paid_from_account_currency or self.paid_from_account_balance): if self.paid_from and (
not self.paid_from_account_currency
or not self.paid_from_account_balance
or not self.paid_from_account_type
):
acc = get_account_details(self.paid_from, self.posting_date, self.cost_center) acc = get_account_details(self.paid_from, self.posting_date, self.cost_center)
self.paid_from_account_currency = acc.account_currency self.paid_from_account_currency = acc.account_currency
self.paid_from_account_balance = acc.account_balance self.paid_from_account_balance = acc.account_balance
self.paid_from_account_type = acc.account_type
if self.paid_to and not (self.paid_to_account_currency or self.paid_to_account_balance): if self.paid_to and (
not self.paid_to_account_currency
or not self.paid_to_account_balance
or not self.paid_to_account_type
):
acc = get_account_details(self.paid_to, self.posting_date, self.cost_center) acc = get_account_details(self.paid_to, self.posting_date, self.cost_center)
self.paid_to_account_currency = acc.account_currency self.paid_to_account_currency = acc.account_currency
self.paid_to_account_balance = acc.account_balance self.paid_to_account_balance = acc.account_balance
self.paid_to_account_type = acc.account_type
self.party_account_currency = ( self.party_account_currency = (
self.paid_from_account_currency self.paid_from_account_currency

View File

@@ -282,4 +282,4 @@
{% } %} {% } %}
</tbody> </tbody>
</table> </table>
<p class="text-right text-muted">{{ __("Printed On ") }}{%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p> <p class="text-right text-muted">{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}</p>

View File

@@ -1,6 +1,3 @@
<div style="margin-bottom: 7px;">
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __("Bank Reconciliation Statement") %}</h2> <h2 class="text-center">{%= __("Bank Reconciliation Statement") %}</h2>
<h4 class="text-center">{%= filters.account && (filters.account + ", "+filters.report_date) || "" %} {%= filters.company %}</h4> <h4 class="text-center">{%= filters.account && (filters.account + ", "+filters.report_date) || "" %} {%= filters.company %}</h4>
<hr> <hr>
@@ -46,4 +43,4 @@
{% } %} {% } %}
</tbody> </tbody>
</table> </table>
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p> <p class="text-right text-muted">{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}</p>

View File

@@ -67,5 +67,5 @@
</tbody> </tbody>
</table> </table>
<p class="text-right text-muted"> <p class="text-right text-muted">
Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %} {%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}
</p> </p>

View File

@@ -78,4 +78,4 @@
{% } %} {% } %}
</tbody> </tbody>
</table> </table>
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p> <p class="text-right text-muted">{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}</p>

View File

@@ -94,9 +94,6 @@
</script> </script>
</head> </head>
<div style="margin-bottom: 7px;" class="text-center">
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __(report.report_name) %}</h2> <h2 class="text-center">{%= __(report.report_name) %}</h2>
<h4 class="text-center">{%= filters.item %} </h4> <h4 class="text-center">{%= filters.item %} </h4>
@@ -124,9 +121,7 @@
</tbody> </tbody>
</table> </table>
<h4 class="text-center"> Analysis Chart </h4> <h4 class="text-center">{%= __("Analysis Chart") %}</h4>
<div id="chart_div"></div> <div id="chart_div"></div>
<p class="text-right text-muted">{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}</p>
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>

View File

@@ -1835,6 +1835,59 @@ class TestStockEntry(FrappeTestCase):
self.assertEqual(sle.stock_value_difference, 100) self.assertEqual(sle.stock_value_difference, 100)
self.assertEqual(sle.stock_value, 100 * i) self.assertEqual(sle.stock_value, 100 * i)
def test_stock_entry_amount(self):
warehouse = "_Test Warehouse - _TC"
rm_item_code = "Test Stock Entry Amount 1"
make_item(rm_item_code, {"is_stock_item": 1})
fg_item_code = "Test Repack Stock Entry Amount 1"
make_item(fg_item_code, {"is_stock_item": 1})
make_stock_entry(
item_code=rm_item_code,
qty=1,
to_warehouse=warehouse,
basic_rate=200,
posting_date=nowdate(),
)
se = make_stock_entry(
item_code=rm_item_code,
qty=1,
purpose="Repack",
basic_rate=100,
do_not_save=True,
)
se.items[0].s_warehouse = warehouse
se.append(
"items",
{
"item_code": fg_item_code,
"qty": 1,
"t_warehouse": warehouse,
"uom": "Nos",
"conversion_factor": 1.0,
},
)
se.set_stock_entry_type()
se.submit()
self.assertEqual(se.items[0].amount, 200)
self.assertEqual(se.items[0].basic_amount, 200)
make_stock_entry(
item_code=rm_item_code,
qty=1,
to_warehouse=warehouse,
basic_rate=300,
posting_date=add_days(nowdate(), -1),
)
se.reload()
self.assertEqual(se.items[0].amount, 300)
self.assertEqual(se.items[0].basic_amount, 300)
def make_serialized_item(**args): def make_serialized_item(**args):
args = frappe._dict(args) args = frappe._dict(args)

View File

@@ -864,7 +864,12 @@ class update_entries_after:
stock_entry.calculate_rate_and_amount(reset_outgoing_rate=False, raise_error_if_no_rate=False) stock_entry.calculate_rate_and_amount(reset_outgoing_rate=False, raise_error_if_no_rate=False)
stock_entry.db_update() stock_entry.db_update()
for d in stock_entry.items: for d in stock_entry.items:
if d.name == voucher_detail_no or (not d.s_warehouse and d.t_warehouse): # Update only the row that matches the voucher_detail_no or the row containing the FG/Scrap Item.
if (
d.name == voucher_detail_no
or (not d.s_warehouse and d.t_warehouse)
or stock_entry.purpose in ["Manufacture", "Repack"]
):
d.db_update() d.db_update()
def update_rate_on_delivery_and_sales_return(self, sle, outgoing_rate): def update_rate_on_delivery_and_sales_return(self, sle, outgoing_rate):

View File

@@ -316,7 +316,7 @@ BOM {0} does not belong to Item {1},Stückliste {0} gehört nicht zum Artikel {1
BOM {0} must be active,Stückliste {0} muss aktiv sein, BOM {0} must be active,Stückliste {0} muss aktiv sein,
BOM {0} must be submitted,Stückliste {0} muss übertragen werden, BOM {0} must be submitted,Stückliste {0} muss übertragen werden,
Balance,Saldo, Balance,Saldo,
Balance (Dr - Cr),Balance (Dr - Cr), Balance (Dr - Cr),Saldo (S - H),
Balance ({0}),Saldo ({0}), Balance ({0}),Saldo ({0}),
Balance Qty,Bilanzmenge, Balance Qty,Bilanzmenge,
Balance Sheet,Bilanz, Balance Sheet,Bilanz,
@@ -4009,6 +4009,7 @@ Partially ordered,teilweise geordnete,
Please select company first,Bitte wählen Sie zuerst die Firma aus, Please select company first,Bitte wählen Sie zuerst die Firma aus,
Please select patient,Bitte wählen Sie Patient, Please select patient,Bitte wählen Sie Patient,
Printed On ,Gedruckt am, Printed On ,Gedruckt am,
Printed on {0},Gedruckt am {0},
Projected qty,Geplante Menge, Projected qty,Geplante Menge,
Sales person,Vertriebsmitarbeiter, Sales person,Vertriebsmitarbeiter,
Serial No {0} Created,Seriennummer {0} Erstellt, Serial No {0} Created,Seriennummer {0} Erstellt,
Can't render this file because it is too large.