Skip to content

Commit

Permalink
chore: resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 committed Sep 16, 2023
2 parents e40d943 + 34bb64e commit ce832d6
Show file tree
Hide file tree
Showing 16 changed files with 187 additions and 212 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,11 @@ jobs:
git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
pgrep honcho | xargs kill
rm -rf ~/frappe-bench/env
bench -v setup env
bench pip install -e ./apps/erpnext
bench start &>> ~/frappe-bench/bench_start.log &
bench --site test_site migrate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
}

this.frm.set_df_property("tax_withholding_category", "hidden", doc.apply_tds ? 0 : 1);
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(me.frm);
}

unblock_invoice() {
Expand Down
20 changes: 10 additions & 10 deletions erpnext/assets/doctype/asset_repair/asset_repair.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ frappe.ui.form.on('Asset Repair', {
}
}
});

let sbb_field = frm.get_docfield('stock_items', 'serial_and_batch_bundle');
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = (row) => {
return {
'item_code': row.doc.item_code,
'voucher_type': frm.doc.doctype,
}
};
}
},

refresh: function(frm) {
Expand All @@ -61,6 +51,16 @@ frappe.ui.form.on('Asset Repair', {
frappe.set_route("query-report", "General Ledger");
});
}

let sbb_field = frm.get_docfield('stock_items', 'serial_and_batch_bundle');
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = (row) => {
return {
'item_code': row.doc.item_code,
'voucher_type': frm.doc.doctype,
}
};
}
},

repair_status: (frm) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import frappe
from frappe import _
from frappe.query_builder.functions import Coalesce, Sum
from frappe.utils import date_diff, flt, getdate
from frappe.utils import cint, date_diff, flt, getdate


def execute(filters=None):
Expand Down Expand Up @@ -47,8 +47,10 @@ def get_data(filters):
mr.transaction_date.as_("date"),
mr_item.schedule_date.as_("required_date"),
mr_item.item_code.as_("item_code"),
Sum(Coalesce(mr_item.stock_qty, 0)).as_("qty"),
Coalesce(mr_item.stock_uom, "").as_("uom"),
Sum(Coalesce(mr_item.qty, 0)).as_("qty"),
Sum(Coalesce(mr_item.stock_qty, 0)).as_("stock_qty"),
Coalesce(mr_item.uom, "").as_("uom"),
Coalesce(mr_item.stock_uom, "").as_("stock_uom"),
Sum(Coalesce(mr_item.ordered_qty, 0)).as_("ordered_qty"),
Sum(Coalesce(mr_item.received_qty, 0)).as_("received_qty"),
(Sum(Coalesce(mr_item.stock_qty, 0)) - Sum(Coalesce(mr_item.received_qty, 0))).as_(
Expand Down Expand Up @@ -96,24 +98,28 @@ def get_conditions(filters, query, mr, mr_item):


def update_qty_columns(row_to_update, data_row):
fields = ["qty", "ordered_qty", "received_qty", "qty_to_receive", "qty_to_order"]
fields = ["qty", "stock_qty", "ordered_qty", "received_qty", "qty_to_receive", "qty_to_order"]
for field in fields:
row_to_update[field] += flt(data_row[field])


def prepare_data(data, filters):
"""Prepare consolidated Report data and Chart data"""
material_request_map, item_qty_map = {}, {}
precision = cint(frappe.db.get_default("float_precision")) or 2

for row in data:
# item wise map for charts
if not row["item_code"] in item_qty_map:
item_qty_map[row["item_code"]] = {
"qty": row["qty"],
"ordered_qty": row["ordered_qty"],
"received_qty": row["received_qty"],
"qty_to_receive": row["qty_to_receive"],
"qty_to_order": row["qty_to_order"],
"qty": flt(row["stock_qty"], precision),
"stock_qty": flt(row["stock_qty"], precision),
"stock_uom": row["stock_uom"],
"uom": row["uom"],
"ordered_qty": flt(row["ordered_qty"], precision),
"received_qty": flt(row["received_qty"], precision),
"qty_to_receive": flt(row["qty_to_receive"], precision),
"qty_to_order": flt(row["qty_to_order"], precision),
}
else:
item_entry = item_qty_map[row["item_code"]]
Expand Down Expand Up @@ -200,21 +206,34 @@ def get_columns(filters):
{"label": _("Item Name"), "fieldname": "item_name", "fieldtype": "Data", "width": 100},
{"label": _("Description"), "fieldname": "description", "fieldtype": "Data", "width": 200},
{
"label": _("Stock UOM"),
"label": _("UOM"),
"fieldname": "uom",
"fieldtype": "Data",
"width": 100,
},
{
"label": _("Stock UOM"),
"fieldname": "stock_uom",
"fieldtype": "Data",
"width": 100,
},
]
)

columns.extend(
[
{
"label": _("Stock Qty"),
"label": _("Qty"),
"fieldname": "qty",
"fieldtype": "Float",
"width": 120,
"width": 140,
"convertible": "qty",
},
{
"label": _("Qty in Stock UOM"),
"fieldname": "stock_qty",
"fieldtype": "Float",
"width": 140,
"convertible": "qty",
},
{
Expand Down
11 changes: 7 additions & 4 deletions erpnext/controllers/buying_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,13 @@ def validate_asset_return(self):
purchase_doc_field = (
"purchase_receipt" if self.doctype == "Purchase Receipt" else "purchase_invoice"
)
not_cancelled_asset = [
d.name
for d in frappe.db.get_all("Asset", {purchase_doc_field: self.return_against, "docstatus": 1})
]
not_cancelled_asset = []
if self.return_against:
not_cancelled_asset = [
d.name
for d in frappe.db.get_all("Asset", {purchase_doc_field: self.return_against, "docstatus": 1})
]

if self.is_return and len(not_cancelled_asset):
frappe.throw(
_(
Expand Down
22 changes: 11 additions & 11 deletions erpnext/manufacturing/doctype/job_card/job_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ frappe.ui.form.on('Job Card', {
}
});

let sbb_field = frm.get_docfield('serial_and_batch_bundle');
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = () => {
return {
'item_code': frm.doc.production_item,
'warehouse': frm.doc.wip_warehouse,
'voucher_type': frm.doc.doctype,
}
};
}

frm.set_indicator_formatter('sub_operation',
function(doc) {
if (doc.status == "Pending") {
Expand Down Expand Up @@ -124,6 +113,17 @@ frappe.ui.form.on('Job Card', {
}
});
}

let sbb_field = frm.get_docfield('serial_and_batch_bundle');
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = () => {
return {
'item_code': frm.doc.production_item,
'warehouse': frm.doc.wip_warehouse,
'voucher_type': frm.doc.doctype,
}
};
}
},

setup_quality_inspection: function(frm) {
Expand Down
5 changes: 2 additions & 3 deletions erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,10 @@ execute:frappe.defaults.clear_default("fiscal_year")
erpnext.patches.v15_0.remove_exotel_integration
erpnext.patches.v14_0.single_to_multi_dunning
execute:frappe.db.set_single_value('Selling Settings', 'allow_negative_rates_for_items', 0)
erpnext.patches.v15_0.correct_asset_value_if_je_with_workflow
erpnext.patches.v15_0.delete_woocommerce_settings_doctype
erpnext.patches.v14_0.migrate_deferred_accounts_to_item_defaults
execute:frappe.delete_doc('DocType', 'Twitter Settings', ignore_missing=True)
execute:frappe.delete_doc('DocType', 'LinkedIn Settings', ignore_missing=True)
execute:frappe.delete_doc('DocType', 'Social Media Post', ignore_missing=True)
erpnext.patches.v15_0.correct_asset_value_if_je_with_workflow
erpnext.patches.v15_0.delete_woocommerce_settings_doctype
# below migration patch should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
41 changes: 22 additions & 19 deletions erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
}
}
});

let sbb_field = this.frm.get_docfield('items', 'serial_and_batch_bundle');
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = (row) => {
return {
'item_code': row.doc.item_code,
}
};
}
}

if(
Expand Down Expand Up @@ -207,15 +198,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
});
}

let batch_no_field = this.frm.get_docfield("items", "batch_no");
if (batch_no_field) {
batch_no_field.get_route_options_for_new_doc = function(row) {
return {
"item": row.doc.item_code
}
};
}

if (this.frm.fields_dict["items"].grid.get_field('blanket_order')) {
this.frm.set_query("blanket_order", "items", function(doc, cdt, cdn) {
var item = locals[cdt][cdn];
Expand Down Expand Up @@ -268,6 +250,28 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
}
]);
}

if(this.frm.fields_dict['items'].grid.get_field('serial_and_batch_bundle')) {
let sbb_field = this.frm.get_docfield('items', 'serial_and_batch_bundle');
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = (row) => {
return {
'item_code': row.doc.item_code,
}
};
}
}

if(this.frm.fields_dict['items'].grid.get_field('batch_no')) {
let batch_no_field = this.frm.get_docfield('items', 'batch_no');
if (batch_no_field) {
batch_no_field.get_route_options_for_new_doc = function(row) {
return {
'item': row.doc.item_code
}
};
}
}
}

is_return() {
Expand Down Expand Up @@ -358,7 +362,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
}

refresh() {

erpnext.toggle_naming_series();
erpnext.hide_company();
this.set_dynamic_labels();
Expand Down
Loading

0 comments on commit ce832d6

Please sign in to comment.