Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
225d4ccb63 | ||
|
|
e09232234e | ||
|
|
a460bf9433 | ||
|
|
30151da57c | ||
|
|
3c8b637a8b | ||
|
|
6fa338bfb7 | ||
|
|
9664790272 | ||
|
|
0a4090a771 | ||
|
|
ebc8bede7f | ||
|
|
19b64496b1 | ||
|
|
f9974f9eb0 | ||
|
|
0eccb01b7b | ||
|
|
ce04f6d7c9 | ||
|
|
424d585962 | ||
|
|
1a7f195d8f | ||
|
|
5b0222615d | ||
|
|
9986c26a0c | ||
|
|
e0c1e3474e | ||
|
|
17dad01ab7 | ||
|
|
9515625135 | ||
|
|
bad1b2a164 | ||
|
|
e2aedc85b4 | ||
|
|
68fe3b4165 | ||
|
|
aed90f73d7 | ||
|
|
ecc756bd52 | ||
|
|
0891399916 | ||
|
|
1436fda041 | ||
|
|
639a71ffd0 | ||
|
|
1f0f31a773 | ||
|
|
3bb4699754 | ||
|
|
3620ddab34 | ||
|
|
8233e22d8b | ||
|
|
1f293edc9e | ||
|
|
13cd12e1e2 | ||
|
|
dfbb2279b6 | ||
|
|
e1d288321f | ||
|
|
c502b562db | ||
|
|
15e3663633 |
@@ -3,7 +3,7 @@ import inspect
|
||||
|
||||
import frappe
|
||||
|
||||
__version__ = "14.78.1"
|
||||
__version__ = "14.78.2"
|
||||
|
||||
|
||||
def get_default_company(user=None):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -156,13 +157,17 @@ class BankTransaction(StatusUpdater):
|
||||
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
|
||||
|
||||
@@ -318,7 +318,7 @@ frappe.ui.form.on("Asset", {
|
||||
}
|
||||
|
||||
frm.dashboard.render_graph({
|
||||
title: "Asset Value",
|
||||
title: __("Asset Value"),
|
||||
data: {
|
||||
labels: x_intervals,
|
||||
datasets: [
|
||||
|
||||
@@ -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]}]},
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
@@ -193,6 +193,24 @@ class BOM(WebsiteGenerator):
|
||||
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")}]
|
||||
|
||||
@@ -755,6 +755,26 @@ class TestBOM(FrappeTestCase):
|
||||
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})
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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")],
|
||||
}
|
||||
)
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -68,7 +68,7 @@ frappe.ui.form.on("Sales Order", {
|
||||
target: frm,
|
||||
setters: [
|
||||
{
|
||||
label: 'Supplier',
|
||||
label: __('Supplier'),
|
||||
fieldname: 'supplier',
|
||||
fieldtype: 'Link',
|
||||
options: 'Supplier'
|
||||
@@ -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",
|
||||
@@ -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'),
|
||||
@@ -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',
|
||||
|
||||
@@ -30,7 +30,7 @@ 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,
|
||||
},
|
||||
@@ -38,7 +38,7 @@ erpnext.PointOfSale.Controller = class {
|
||||
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) => {
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
@@ -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>
|
||||
|
||||
@@ -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)'}
|
||||
@@ -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();
|
||||
@@ -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 {
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -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]}]},
|
||||
|
||||
@@ -713,7 +713,7 @@ def make_sales_invoice(source_name, target_doc=None, args=None):
|
||||
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
|
||||
|
||||
@@ -173,13 +173,10 @@ class InventoryDimension(Document):
|
||||
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)
|
||||
@@ -198,8 +195,17 @@ class InventoryDimension(Document):
|
||||
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 [
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{% if doc.status == "Open" %}
|
||||
{{ doc.priority }}
|
||||
{% else %}
|
||||
{{ doc.status }}
|
||||
{{ _(doc.status) }}
|
||||
{%- endif -%}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<span class="indicator-pill {{ " red" if doc.status=="Open" else "darkgrey" }}">
|
||||
{{ doc.status }}</span>
|
||||
{{ _(doc.status) }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if doc["_assign"] %}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<span class="indicator-pill {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "gray") }} list-item-status">{{doc.status}}</span>
|
||||
<span class="indicator-pill {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "gray") }} list-item-status">{{ _(doc.status) }}</span>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div class="small text-muted items-preview ellipsis ellipsis-width">
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<input type="text" class="form-control" name="Hours" readonly value= "{{ doc.hours }}">
|
||||
|
||||
<label for="status" class="control-label text-muted small">{{ __("Status") }}</label>
|
||||
<input type="text" class="form-control" name="status" readonly value= "{{ doc.status }}">
|
||||
<input type="text" class="form-control" name="status" readonly value= "{{ _(doc.status) }}">
|
||||
|
||||
<label for="Note" class="control-label text-muted small">{{ __("Note") }}</label>
|
||||
<textarea class="form-control" name="Hours" readonly> {{ doc.note }} </textarea>
|
||||
|
||||
Reference in New Issue
Block a user