Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release v14 #44639

Merged
merged 36 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
15e3663
fix: required by date in the reorder material request (backport #4449…
mergify[bot] Dec 4, 2024
c502b56
fix: inv dimensions fields not creating for standard doctype (backpor…
mergify[bot] Dec 5, 2024
e1d2883
refactor: translatable label on pos payments (#42081)
mahsem Dec 5, 2024
dfbb227
fix: strings for translation in pos_past_order_summary.js
mahsem Dec 4, 2024
13cd12e
Merge pull request #44521 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 5, 2024
1f293ed
Merge pull request #44523 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 5, 2024
8233e22
fix: add label strings for translation in pos_controller.js
mahsem Dec 4, 2024
3620dda
fix: add labels for translation in sales_order.js
mahsem Dec 4, 2024
3bb4699
Merge pull request #44525 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 5, 2024
1f0f31a
fix: add strings for translation in pos_item_cart.js
mahsem Dec 4, 2024
639a71f
chore: linter fix
ruthra-kumar Dec 5, 2024
1436fda
Merge pull request #44519 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 5, 2024
0891399
Merge pull request #44527 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 5, 2024
ecc756b
fix: incorrect stock UOM for BOM raw materials (backport #44528) (#44…
mergify[bot] Dec 5, 2024
aed90f7
fix: add title for translation in asset.js
mahsem Dec 5, 2024
68fe3b4
Merge pull request #44543 from frappe/mergify/bp/version-14-hotfix/pr…
khushi8112 Dec 5, 2024
e2aedc8
fix: variant qty while making work order from BOM (backport #44548) (…
mergify[bot] Dec 5, 2024
bad1b2a
fix: add labels for translation in sales_order_analysis.py
mahsem Dec 5, 2024
9515625
Merge pull request #44561 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 6, 2024
17dad01
fix: add strings for translation payment_terms_status_for_sales_order.py
mahsem Dec 5, 2024
e0c1e34
Merge pull request #44563 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 6, 2024
9986c26
fix: add labels for translation in quality_inspection_summary.py
mahsem Dec 5, 2024
5b02226
Merge pull request #44567 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 6, 2024
1a7f195
fix: add labels for translation in production_analytics.py
mahsem Dec 5, 2024
424d585
Merge pull request #44569 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 6, 2024
ce04f6d
fix: add string for translation in delayed_tasks_summary.py
mahsem Dec 5, 2024
0eccb01
Merge pull request #44565 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 6, 2024
f9974f9
fix: add labels for translation in purchase_order_analysis.py
mahsem Dec 5, 2024
19b6449
Merge pull request #44571 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 6, 2024
ebc8bed
fix(Bank Transaction): error in party matching should not block submi…
mergify[bot] Dec 6, 2024
0a4090a
fix: add docstatus for translation
mahsem Dec 6, 2024
9664790
chore: fix linter
ruthra-kumar Dec 9, 2024
6fa338b
Merge pull request #44602 from frappe/mergify/bp/version-14-hotfix/pr…
ruthra-kumar Dec 9, 2024
3c8b637
fix: prevent set_payment_schedule on return documents
ruthra-kumar Dec 9, 2024
30151da
Merge pull request #44611 from ruthra-kumar/backport_v14_44495
ruthra-kumar Dec 9, 2024
a460bf9
fix: description overwrite on qty change (backport #44606) (#44608)
mergify[bot] Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions erpnext/accounts/doctype/bank_transaction/bank_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# For license information, please see license.txt

import frappe
from frappe import _
from frappe.model.docstatus import DocStatus
from frappe.utils import flt

Expand Down Expand Up @@ -156,13 +157,17 @@ def auto_set_party(self):
if self.party_type and self.party:
return

result = AutoMatchParty(
bank_party_account_number=self.bank_party_account_number,
bank_party_iban=self.bank_party_iban,
bank_party_name=self.bank_party_name,
description=self.description,
deposit=self.deposit,
).match()
result = None
try:
result = AutoMatchParty(
bank_party_account_number=self.bank_party_account_number,
bank_party_iban=self.bank_party_iban,
bank_party_name=self.bank_party_name,
description=self.description,
deposit=self.deposit,
).match()
except Exception:
frappe.log_error(title=_("Error in party matching for Bank Transaction {0}").format(self.name))

if result:
party_type, party = result
Expand Down
2 changes: 1 addition & 1 deletion erpnext/assets/doctype/asset/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ frappe.ui.form.on("Asset", {
}

frm.dashboard.render_graph({
title: "Asset Value",
title: __("Asset Value"),
data: {
labels: x_intervals,
datasets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def prepare_data(data, filters):


def prepare_chart_data(pending, completed):
labels = ["Amount to Bill", "Billed Amount"]
labels = [_("Amount to Bill"), _("Billed Amount")]

return {
"data": {"labels": labels, "datasets": [{"values": [pending, completed]}]},
Expand Down
2 changes: 1 addition & 1 deletion erpnext/manufacturing/doctype/bom/bom.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ frappe.ui.form.on("BOM", {
dialog.fields_dict.items.df.data.push({
item_code: d.item_code,
variant_item_code: "",
qty: d.qty,
qty: (d.qty / frm.doc.quantity) * (dialog.fields_dict.qty.value || 1),
source_warehouse: d.source_warehouse,
operation: d.operation,
});
Expand Down
18 changes: 18 additions & 0 deletions erpnext/manufacturing/doctype/bom/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,24 @@ def validate(self):
self.update_cost(update_parent=False, from_child_bom=True, update_hour_rate=False, save=False)
self.set_process_loss_qty()
self.validate_scrap_items()
self.set_default_uom()

def set_default_uom(self):
if not self.get("items"):
return

item_wise_uom = frappe._dict(
frappe.get_all(
"Item",
filters={"name": ("in", [item.item_code for item in self.items])},
fields=["name", "stock_uom"],
as_list=1,
)
)

for row in self.get("items"):
if row.stock_uom != item_wise_uom.get(row.item_code):
row.stock_uom = item_wise_uom.get(row.item_code)

def get_context(self, context):
context.parents = [{"name": "boms", "title": _("All BOMs")}]
Expand Down
20 changes: 20 additions & 0 deletions erpnext/manufacturing/doctype/bom/test_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,26 @@ def test_do_not_include_manufacturing_and_fixed_items(self):
self.assertTrue("_Test RM Item 2 Fixed Asset Item" not in items)
self.assertTrue("_Test RM Item 3 Manufacture Item" in items)

def test_bom_raw_materials_stock_uom(self):
rm_item = make_item(
properties={"is_stock_item": 1, "valuation_rate": 1000.0, "stock_uom": "Nos"}
).name
fg_item = make_item(properties={"is_stock_item": 1}).name

from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom

bom = make_bom(item=fg_item, raw_materials=[rm_item], do_not_submit=True)
for row in bom.items:
self.assertEqual(row.stock_uom, "Nos")

frappe.db.set_value("Item", rm_item, "stock_uom", "Kg")

bom.items[0].qty = 2
bom.save()

for row in bom.items:
self.assertEqual(row.stock_uom, "Kg")


def get_default_bom(item_code="_Test FG Item 2"):
return frappe.db.get_value("BOM", {"item": item_code, "is_active": 1, "is_default": 1})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ def get_chart_data(periodic_data, columns):
pending.append(periodic_data.get("Pending").get(d))
completed.append(periodic_data.get("Completed").get(d))

datasets.append({"name": "All Work Orders", "values": all_data})
datasets.append({"name": "Not Started", "values": not_start})
datasets.append({"name": "Overdue", "values": overdue})
datasets.append({"name": "Pending", "values": pending})
datasets.append({"name": "Completed", "values": completed})
datasets.append({"name": _("All Work Orders"), "values": all_data})
datasets.append({"name": _("Not Started"), "values": not_start})
datasets.append({"name": _("Overdue"), "values": overdue})
datasets.append({"name": _("Pending"), "values": pending})
datasets.append({"name": _("Completed"), "values": completed})

chart = {"data": {"labels": labels, "datasets": datasets}}
chart["type"] = "line"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_data(filters):


def get_chart_data(periodic_data, columns):
labels = ["Rejected", "Accepted"]
labels = [_("Rejected"), _("Accepted")]

status_wise_data = {"Accepted": 0, "Rejected": 0}

Expand All @@ -53,7 +53,7 @@ def get_chart_data(periodic_data, columns):

datasets.append(
{
"name": "Qty Wise Chart",
"name": _("Qty Wise Chart"),
"values": [status_wise_data.get("Rejected"), status_wise_data.get("Accepted")],
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def get_chart_data(data):
on_track = on_track + 1
charts = {
"data": {
"labels": ["On Track", "Delayed"],
"datasets": [{"name": "Delayed", "values": [on_track, delay]}],
"labels": [_("On Track"), _("Delayed")],
"datasets": [{"name": _("Delayed"), "values": [on_track, delay]}],
},
"type": "percentage",
"colors": ["#84D5BA", "#CB4B5F"],
Expand Down
8 changes: 4 additions & 4 deletions erpnext/selling/doctype/sales_order/sales_order.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ frappe.ui.form.on("Sales Order", {
target: frm,
setters: [
{
label: 'Supplier',
label: __('Supplier'),
fieldname: 'supplier',
fieldtype: 'Link',
options: 'Supplier'
Expand Down Expand Up @@ -376,7 +376,7 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex
target: me.frm,
setters: [
{
label: "Customer",
label: __("Customer"),
fieldname: "party_name",
fieldtype: "Link",
options: "Customer",
Expand Down Expand Up @@ -430,7 +430,7 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex
}
else {
const fields = [{
label: 'Items',
label: __('Items'),
fieldtype: 'Table',
fieldname: 'items',
description: __('Select BOM and Qty for Production'),
Expand Down Expand Up @@ -724,7 +724,7 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex
"default": 0
},
{
fieldname: 'items_for_po', fieldtype: 'Table', label: 'Select Items',
fieldname: 'items_for_po', fieldtype: 'Table', label: __('Select Items'),
fields: [
{
fieldtype:'Data',
Expand Down
6 changes: 3 additions & 3 deletions erpnext/selling/page/point_of_sale/pos_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ erpnext.PointOfSale.Controller = class {
fieldname: "mode_of_payment",
fieldtype: "Link",
in_list_view: 1,
label: "Mode of Payment",
label: __("Mode of Payment"),
options: "Mode of Payment",
reqd: 1,
},
{
fieldname: "opening_amount",
fieldtype: "Currency",
in_list_view: 1,
label: "Opening Amount",
label: __("Opening Amount"),
options: "company:company_currency",
change: function () {
dialog.fields_dict.balance_details.df.data.some((d) => {
Expand Down Expand Up @@ -87,7 +87,7 @@ erpnext.PointOfSale.Controller = class {
{
fieldname: "balance_details",
fieldtype: "Table",
label: "Opening Balance Details",
label: __("Opening Balance Details"),
cannot_add_rows: false,
in_place_edit: true,
reqd: 1,
Expand Down
8 changes: 5 additions & 3 deletions erpnext/selling/page/point_of_sale/pos_item_cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,13 +959,15 @@ erpnext.PointOfSale.ItemCart = class {

if (!res.length) {
transaction_container.html(
`<div class="no-transactions-placeholder">No recent transactions found</div>`
`<div class="no-transactions-placeholder">${__("No recent transactions found")}</div>`
);
return;
}

const elapsed_time = moment(res[0].posting_date + " " + res[0].posting_time).fromNow();
this.$customer_section.find(".customer-desc").html(`Last transacted ${elapsed_time}`);
this.$customer_section
.find(".customer-desc")
.html(`${__("Last transacted")} ${__(elapsed_time)}`);

res.forEach((invoice) => {
const posting_datetime = moment(invoice.posting_date + " " + invoice.posting_time).format(
Expand All @@ -990,7 +992,7 @@ erpnext.PointOfSale.ItemCart = class {
</div>
<div class="invoice-status">
<span class="indicator-pill whitespace-nowrap ${indicator_color[invoice.status]}">
<span>${invoice.status}</span>
<span>${__(invoice.status)}</span>
</span>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions erpnext/selling/page/point_of_sale/pos_past_order_summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ erpnext.PointOfSale.PastOrderSummary = class {

init_email_print_dialog() {
const email_dialog = new frappe.ui.Dialog({
title: "Email Receipt",
title: __("Email Receipt"),
fields: [
{ fieldname: "email_id", fieldtype: "Data", options: "Email", label: "Email ID" },
// {fieldname:'remarks', fieldtype:'Text', label:'Remarks (if any)'}
Expand All @@ -59,7 +59,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
this.email_dialog = email_dialog;

const print_dialog = new frappe.ui.Dialog({
title: "Print Receipt",
title: __("Print Receipt"),
fields: [{ fieldname: "print", fieldtype: "Data", label: "Print Preview" }],
primary_action: () => {
this.print_receipt();
Expand Down Expand Up @@ -112,7 +112,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
get_discount_html(doc) {
if (doc.discount_amount) {
return `<div class="summary-row-wrapper">
<div>Discount (${doc.additional_discount_percentage} %)</div>
<div>${__("Discount")} (${doc.additional_discount_percentage} %)</div>
<div>${format_currency(doc.discount_amount, doc.currency)}</div>
</div>`;
} else {
Expand Down
2 changes: 1 addition & 1 deletion erpnext/selling/page/point_of_sale/pos_payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ erpnext.PointOfSale.Payment = class {
const remaining = grand_total - doc.paid_amount;
const change = doc.change_amount || remaining <= 0 ? -1 * remaining : undefined;
const currency = doc.currency;
const label = change ? __("Change") : __("To Be Paid");
const label = __("Change Amount");

this.$totals.html(
`<div class="col">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ def prepare_chart(s_orders):
"labels": [term.payment_term for term in s_orders],
"datasets": [
{
"name": "Payment Amount",
"name": _("Payment Amount"),
"values": [x.base_payment_amount for x in s_orders],
},
{
"name": "Paid Amount",
"name": _("Paid Amount"),
"values": [x.paid_amount for x in s_orders],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def prepare_data(data, so_elapsed_time, filters):


def prepare_chart_data(pending, completed):
labels = ["Amount to Bill", "Billed Amount"]
labels = [_("Amount to Bill"), _("Billed Amount")]

return {
"data": {"labels": labels, "datasets": [{"values": [pending, completed]}]},
Expand Down
2 changes: 1 addition & 1 deletion erpnext/stock/doctype/delivery_note/delivery_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def get_pending_qty(item_row):
automatically_fetch_payment_terms = cint(
frappe.db.get_single_value("Accounts Settings", "automatically_fetch_payment_terms")
)
if automatically_fetch_payment_terms:
if automatically_fetch_payment_terms and not doc.is_return:
doc.set_payment_schedule()

return doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,10 @@ def add_custom_fields(self):
dimension_fields = []
if self.apply_to_all_doctypes:
for doctype in get_inventory_documents():
if field_exists(doctype[0], self.source_fieldname):
continue

dimension_fields = self.get_dimension_fields(doctype[0])
self.add_transfer_field(doctype[0], dimension_fields)
custom_fields.setdefault(doctype[0], dimension_fields)
elif not field_exists(self.document_type, self.source_fieldname):
else:
dimension_fields = self.get_dimension_fields()

self.add_transfer_field(self.document_type, dimension_fields)
Expand All @@ -198,8 +195,17 @@ def add_custom_fields(self):
dimension_field["fieldname"] = self.target_fieldname
custom_fields["Stock Ledger Entry"] = dimension_field

filter_custom_fields = {}
if custom_fields:
create_custom_fields(custom_fields)
for doctype, fields in custom_fields.items():
if isinstance(fields, dict):
fields = [fields]

for field in fields:
if not field_exists(doctype, field["fieldname"]):
filter_custom_fields.setdefault(doctype, []).append(field)

create_custom_fields(filter_custom_fields)

def add_transfer_field(self, doctype, dimension_fields):
if doctype not in [
Expand Down
13 changes: 9 additions & 4 deletions erpnext/stock/doctype/material_request/material_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,16 @@ frappe.ui.form.on('Material Request', {
},
callback: function(r) {
const d = item;
const allow_to_change_fields = ['actual_qty', 'projected_qty', 'min_order_qty', 'item_name', 'description', 'stock_uom', 'uom', 'conversion_factor', 'stock_qty'];

if(!r.exc) {
$.each(r.message, function(key, value) {
if(!d[key] || allow_to_change_fields.includes(key)) {
let allow_to_change_fields = ['actual_qty', 'projected_qty', 'min_order_qty', 'item_name', 'description', 'stock_uom', 'uom', 'conversion_factor', 'stock_qty'];

if (overwrite_warehouse) {
allow_to_change_fields.push("description");
}

if (!r.exc) {
$.each(r.message, function (key, value) {
if (!d[key] || allow_to_change_fields.includes(key)) {
d[key] = value;
}
});
Expand Down
Loading
Loading