Merge branch 'frappe:develop' into develop

This commit is contained in:
viralkansodiya15 2023-10-30 12:12:47 +05:30 committed by GitHub
commit 76c61c1b04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 307 additions and 865 deletions

View File

@ -89,7 +89,6 @@ class BankTransaction(StatusUpdater):
- 0 > a: Error: already over-allocated - 0 > a: Error: already over-allocated
- clear means: set the latest transaction date as clearance date - clear means: set the latest transaction date as clearance date
""" """
gl_bank_account = frappe.db.get_value("Bank Account", self.bank_account, "account")
remaining_amount = self.unallocated_amount remaining_amount = self.unallocated_amount
for payment_entry in self.payment_entries: for payment_entry in self.payment_entries:
if payment_entry.allocated_amount == 0.0: if payment_entry.allocated_amount == 0.0:

View File

@ -771,19 +771,28 @@ class TestPOSInvoice(unittest.TestCase):
) )
create_batch_item_with_batch("_BATCH ITEM Test For Reserve", "TestBatch-RS 02") create_batch_item_with_batch("_BATCH ITEM Test For Reserve", "TestBatch-RS 02")
make_stock_entry( se = make_stock_entry(
target="_Test Warehouse - _TC", target="_Test Warehouse - _TC",
item_code="_BATCH ITEM Test For Reserve", item_code="_BATCH ITEM Test For Reserve",
qty=20, qty=30,
basic_rate=100, basic_rate=100,
batch_no="TestBatch-RS 02",
) )
se.reload()
batch_no = get_batch_from_bundle(se.items[0].serial_and_batch_bundle)
# POS Invoice 1, for the batch without bundle
pos_inv1 = create_pos_invoice( pos_inv1 = create_pos_invoice(
item="_BATCH ITEM Test For Reserve", rate=300, qty=15, batch_no="TestBatch-RS 02" item="_BATCH ITEM Test For Reserve", rate=300, qty=15, do_not_save=1
) )
pos_inv1.items[0].batch_no = batch_no
pos_inv1.save() pos_inv1.save()
pos_inv1.submit() pos_inv1.submit()
pos_inv1.reload()
self.assertFalse(pos_inv1.items[0].serial_and_batch_bundle)
batches = get_auto_batch_nos( batches = get_auto_batch_nos(
frappe._dict( frappe._dict(
@ -792,7 +801,24 @@ class TestPOSInvoice(unittest.TestCase):
) )
for batch in batches: for batch in batches:
if batch.batch_no == "TestBatch-RS 02" and batch.warehouse == "_Test Warehouse - _TC": if batch.batch_no == batch_no and batch.warehouse == "_Test Warehouse - _TC":
self.assertEqual(batch.qty, 15)
# POS Invoice 2, for the batch with bundle
pos_inv2 = create_pos_invoice(
item="_BATCH ITEM Test For Reserve", rate=300, qty=10, batch_no=batch_no
)
pos_inv2.reload()
self.assertTrue(pos_inv2.items[0].serial_and_batch_bundle)
batches = get_auto_batch_nos(
frappe._dict(
{"item_code": "_BATCH ITEM Test For Reserve", "warehouse": "_Test Warehouse - _TC"}
)
)
for batch in batches:
if batch.batch_no == batch_no and batch.warehouse == "_Test Warehouse - _TC":
self.assertEqual(batch.qty, 5) self.assertEqual(batch.qty, 5)
def test_pos_batch_item_qty_validation(self): def test_pos_batch_item_qty_validation(self):

View File

@ -585,7 +585,6 @@ class PurchaseInvoice(BuyingController):
def get_gl_entries(self, warehouse_account=None): def get_gl_entries(self, warehouse_account=None):
self.auto_accounting_for_stock = erpnext.is_perpetual_inventory_enabled(self.company) self.auto_accounting_for_stock = erpnext.is_perpetual_inventory_enabled(self.company)
self.asset_received_but_not_billed = self.get_company_default("asset_received_but_not_billed")
if self.auto_accounting_for_stock: if self.auto_accounting_for_stock:
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed") self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
@ -937,10 +936,11 @@ class PurchaseInvoice(BuyingController):
) )
stock_rbnb = ( stock_rbnb = (
self.asset_received_but_not_billed self.get_company_default("asset_received_but_not_billed")
if item.is_fixed_asset if item.is_fixed_asset
else self.stock_received_but_not_billed else self.stock_received_but_not_billed
) )
if not negative_expense_booked_in_pr: if not negative_expense_booked_in_pr:
gl_entries.append( gl_entries.append(
self.get_gl_dict( self.get_gl_dict(
@ -1664,6 +1664,7 @@ def make_purchase_receipt(source_name, target_doc=None):
"po_detail": "purchase_order_item", "po_detail": "purchase_order_item",
"material_request": "material_request", "material_request": "material_request",
"material_request_item": "material_request_item", "material_request_item": "material_request_item",
"wip_composite_asset": "wip_composite_asset",
}, },
"postprocess": update_item, "postprocess": update_item,
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty), "condition": lambda doc: abs(doc.received_qty) < abs(doc.qty),

View File

@ -32,13 +32,6 @@ frappe.query_reports["Profitability Analysis"] = {
"label": __("Accounting Dimension"), "label": __("Accounting Dimension"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Accounting Dimension", "options": "Accounting Dimension",
"get_query": () =>{
return {
filters: {
"disabled": 0
}
}
}
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",

View File

@ -68,7 +68,7 @@ def get_result(
tax_amount += entry.credit - entry.debit tax_amount += entry.credit - entry.debit
if net_total_map.get(name): if net_total_map.get(name):
if voucher_type == "Journal Entry": if voucher_type == "Journal Entry" and tax_amount and rate:
# back calcalute total amount from rate and tax_amount # back calcalute total amount from rate and tax_amount
total_amount = grand_total = base_total = tax_amount / (rate / 100) total_amount = grand_total = base_total = tax_amount / (rate / 100)
else: else:

View File

@ -9,7 +9,6 @@ frappe.ui.form.on('Asset', {
frm.set_query("item_code", function() { frm.set_query("item_code", function() {
return { return {
"filters": { "filters": {
"disabled": 0,
"is_fixed_asset": 1, "is_fixed_asset": 1,
"is_stock_item": 0 "is_stock_item": 0
} }

View File

@ -221,11 +221,11 @@
"read_only": 1 "read_only": 1
}, },
{ {
"depends_on": "eval:!(doc.is_composite_asset && !doc.capitalized_in)",
"fieldname": "gross_purchase_amount", "fieldname": "gross_purchase_amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Gross Purchase Amount", "label": "Gross Purchase Amount",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"read_only": 1,
"read_only_depends_on": "eval:!doc.is_existing_asset", "read_only_depends_on": "eval:!doc.is_existing_asset",
"reqd": 1 "reqd": 1
}, },
@ -399,6 +399,7 @@
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"depends_on": "eval:!doc.is_composite_asset && !doc.is_existing_asset",
"fieldname": "purchase_receipt", "fieldname": "purchase_receipt",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Purchase Receipt", "label": "Purchase Receipt",
@ -416,6 +417,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"depends_on": "eval:!doc.is_composite_asset && !doc.is_existing_asset",
"fieldname": "purchase_invoice", "fieldname": "purchase_invoice",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Purchase Invoice", "label": "Purchase Invoice",
@ -479,10 +481,11 @@
"read_only": 1 "read_only": 1
}, },
{ {
"depends_on": "eval.doc.asset_quantity",
"fieldname": "asset_quantity", "fieldname": "asset_quantity",
"fieldtype": "Int", "fieldtype": "Int",
"label": "Asset Quantity", "label": "Asset Quantity",
"read_only_depends_on": "eval:!doc.is_existing_asset && !doc.is_composite_asset" "read_only": 1
}, },
{ {
"fieldname": "depr_entry_posting_status", "fieldname": "depr_entry_posting_status",
@ -562,9 +565,14 @@
"link_doctype": "Journal Entry", "link_doctype": "Journal Entry",
"link_fieldname": "reference_name", "link_fieldname": "reference_name",
"table_fieldname": "accounts" "table_fieldname": "accounts"
},
{
"group": "Asset Capitalization",
"link_doctype": "Asset Capitalization",
"link_fieldname": "target_asset"
} }
], ],
"modified": "2023-10-03 23:28:26.732269", "modified": "2023-10-27 17:03:46.629617",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Assets", "module": "Assets",
"name": "Asset", "name": "Asset",
@ -608,4 +616,4 @@
"states": [], "states": [],
"title_field": "asset_name", "title_field": "asset_name",
"track_changes": 1 "track_changes": 1
} }

View File

@ -876,12 +876,8 @@ def get_items_tagged_to_wip_composite_asset(asset):
"amount", "amount",
] ]
pi_items = frappe.get_all(
"Purchase Invoice Item", filters={"wip_composite_asset": asset}, fields=fields
)
pr_items = frappe.get_all( pr_items = frappe.get_all(
"Purchase Receipt Item", filters={"wip_composite_asset": asset}, fields=fields "Purchase Receipt Item", filters={"wip_composite_asset": asset}, fields=fields
) )
return pi_items + pr_items return pr_items

View File

@ -558,6 +558,7 @@ def make_purchase_receipt(source_name, target_doc=None):
"material_request_item": "material_request_item", "material_request_item": "material_request_item",
"sales_order": "sales_order", "sales_order": "sales_order",
"sales_order_item": "sales_order_item", "sales_order_item": "sales_order_item",
"wip_composite_asset": "wip_composite_asset",
}, },
"postprocess": update_item, "postprocess": update_item,
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty) "condition": lambda doc: abs(doc.received_qty) < abs(doc.qty)
@ -634,6 +635,7 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
"field_map": { "field_map": {
"name": "po_detail", "name": "po_detail",
"parent": "purchase_order", "parent": "purchase_order",
"wip_composite_asset": "wip_composite_asset",
}, },
"postprocess": update_item, "postprocess": update_item,
"condition": lambda doc: (doc.base_amount == 0 or abs(doc.billed_amt) < abs(doc.amount)), "condition": lambda doc: (doc.base_amount == 0 or abs(doc.billed_amt) < abs(doc.amount)),

View File

@ -86,6 +86,8 @@
"billed_amt", "billed_amt",
"accounting_details", "accounting_details",
"expense_account", "expense_account",
"column_break_fyqr",
"wip_composite_asset",
"manufacture_details", "manufacture_details",
"manufacturer", "manufacturer",
"manufacturer_part_no", "manufacturer_part_no",
@ -896,13 +898,23 @@
"fieldname": "apply_tds", "fieldname": "apply_tds",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Apply TDS" "label": "Apply TDS"
},
{
"fieldname": "wip_composite_asset",
"fieldtype": "Link",
"label": "WIP Composite Asset",
"options": "Asset"
},
{
"fieldname": "column_break_fyqr",
"fieldtype": "Column Break"
} }
], ],
"idx": 1, "idx": 1,
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2023-09-13 16:22:40.825092", "modified": "2023-10-27 15:50:42.655573",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Purchase Order Item", "name": "Purchase Order Item",
@ -915,4 +927,4 @@
"sort_order": "DESC", "sort_order": "DESC",
"states": [], "states": [],
"track_changes": 1 "track_changes": 1
} }

View File

@ -44,11 +44,6 @@ frappe.query_reports["Supplier Quotation Comparison"] = {
} }
} }
} }
else {
return {
filters: { "disabled": 0 }
}
}
} }
}, },
{ {

View File

@ -7,7 +7,7 @@ import frappe
from frappe import _ from frappe import _
from frappe.desk.doctype.tag.tag import add_tag from frappe.desk.doctype.tag.tag import add_tag
from frappe.model.document import Document from frappe.model.document import Document
from frappe.utils import add_months, formatdate, getdate, today from frappe.utils import add_months, formatdate, getdate, sbool, today
from plaid.errors import ItemError from plaid.errors import ItemError
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
@ -237,8 +237,6 @@ def new_bank_transaction(transaction):
deposit = abs(amount) deposit = abs(amount)
withdrawal = 0.0 withdrawal = 0.0
status = "Pending" if transaction["pending"] == True else "Settled"
tags = [] tags = []
if transaction["category"]: if transaction["category"]:
try: try:
@ -247,13 +245,14 @@ def new_bank_transaction(transaction):
except KeyError: except KeyError:
pass pass
if not frappe.db.exists("Bank Transaction", dict(transaction_id=transaction["transaction_id"])): if not frappe.db.exists(
"Bank Transaction", dict(transaction_id=transaction["transaction_id"])
) and not sbool(transaction["pending"]):
try: try:
new_transaction = frappe.get_doc( new_transaction = frappe.get_doc(
{ {
"doctype": "Bank Transaction", "doctype": "Bank Transaction",
"date": getdate(transaction["date"]), "date": getdate(transaction["date"]),
"status": status,
"bank_account": bank_account, "bank_account": bank_account,
"deposit": deposit, "deposit": deposit,
"withdrawal": withdrawal, "withdrawal": withdrawal,

View File

@ -12,7 +12,7 @@ frappe.query_reports["BOM Operations Time"] = {
"options": "Item", "options": "Item",
"get_query": () =>{ "get_query": () =>{
return { return {
filters: { "disabled": 0, "is_stock_item": 1 } filters: { "is_stock_item": 1 }
} }
} }
}, },

View File

@ -342,5 +342,6 @@ erpnext.patches.v15_0.delete_payment_gateway_doctypes
erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item
erpnext.patches.v15_0.update_sre_from_voucher_details erpnext.patches.v15_0.update_sre_from_voucher_details
erpnext.patches.v14_0.rename_over_order_allowance_field erpnext.patches.v14_0.rename_over_order_allowance_field
erpnext.patches.v14_0.migrate_delivery_stop_lock_field
# below migration patch should always run last # below migration patch should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger erpnext.patches.v14_0.migrate_gl_to_payment_ledger

View File

@ -0,0 +1,7 @@
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
if frappe.db.has_column("Delivery Stop", "lock"):
rename_field("Delivery Stop", "lock", "locked")

View File

@ -30,7 +30,6 @@ erpnext.accounts.taxes = {
filters: { filters: {
"account_type": account_type, "account_type": account_type,
"company": doc.company, "company": doc.company,
"disabled": 0
} }
} }
}); });

View File

@ -1,815 +1,197 @@
{ {
"allow_copy": 0, "actions": [],
"allow_events_in_timeline": 0, "creation": "2017-10-16 16:46:28.166950",
"allow_guest_to_view": 0, "doctype": "DocType",
"allow_import": 0, "editable_grid": 1,
"allow_rename": 0, "engine": "InnoDB",
"beta": 0, "field_order": [
"creation": "2017-10-16 16:46:28.166950", "customer",
"custom": 0, "address",
"docstatus": 0, "locked",
"doctype": "DocType", "column_break_6",
"document_type": "", "customer_address",
"editable_grid": 1, "visited",
"engine": "InnoDB", "order_information_section",
"delivery_note",
"cb_order",
"grand_total",
"section_break_7",
"contact",
"email_sent_to",
"column_break_7",
"customer_contact",
"section_break_9",
"distance",
"estimated_arrival",
"lat",
"column_break_19",
"uom",
"lng",
"more_information_section",
"details"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "customer",
"allow_on_submit": 0, "fieldtype": "Link",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Customer",
"columns": 2, "options": "Customer"
"fieldname": "customer", },
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Customer",
"length": 0,
"no_copy": 0,
"options": "Customer",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "address",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Address Name",
"collapsible": 0, "options": "Address",
"columns": 0, "print_hide": 1,
"fieldname": "address", "reqd": 1
"fieldtype": "Link", },
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Address Name",
"length": 0,
"no_copy": 0,
"options": "Address",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "default": "0",
"allow_in_quick_entry": 0, "fieldname": "locked",
"allow_on_submit": 0, "fieldtype": "Check",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Locked"
"columns": 0, },
"fieldname": "lock",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Lock",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_6",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_6",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "customer_address",
"allow_in_quick_entry": 0, "fieldtype": "Small Text",
"allow_on_submit": 0, "label": "Customer Address",
"bold": 0, "read_only": 1
"collapsible": 0, },
"columns": 0,
"fieldname": "customer_address",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer Address",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "allow_on_submit": 1,
"allow_in_quick_entry": 0, "default": "0",
"allow_on_submit": 1, "depends_on": "eval:doc.docstatus==1",
"bold": 0, "fieldname": "visited",
"collapsible": 0, "fieldtype": "Check",
"columns": 0, "label": "Visited",
"depends_on": "eval:doc.docstatus==1", "no_copy": 1,
"fieldname": "visited", "print_hide": 1
"fieldtype": "Check", },
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Visited",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "order_information_section",
"allow_in_quick_entry": 0, "fieldtype": "Section Break",
"allow_on_submit": 0, "label": "Order Information"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fieldname": "order_information_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Order Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "delivery_note",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Delivery Note",
"collapsible": 0, "no_copy": 1,
"columns": 0, "options": "Delivery Note",
"fieldname": "delivery_note", "print_hide": 1,
"fieldtype": "Link", "read_only": 1
"hidden": 0, },
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Delivery Note",
"length": 0,
"no_copy": 1,
"options": "Delivery Note",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "cb_order",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cb_order",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "grand_total",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "label": "Grand Total",
"bold": 0, "read_only": 1
"collapsible": 0, },
"columns": 0,
"fieldname": "grand_total",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Grand Total",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_7",
"allow_in_quick_entry": 0, "fieldtype": "Section Break",
"allow_on_submit": 0, "label": "Contact Information"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Contact Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "contact",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Contact Name",
"bold": 0, "options": "Contact",
"collapsible": 0, "print_hide": 1
"columns": 0, },
"fieldname": "contact",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Contact Name",
"length": 0,
"no_copy": 0,
"options": "Contact",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "email_sent_to",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "label": "Email sent to",
"bold": 0, "read_only": 1
"collapsible": 0, },
"columns": 0,
"fieldname": "email_sent_to",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email sent to",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_7",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_7",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "customer_contact",
"allow_in_quick_entry": 0, "fieldtype": "Small Text",
"allow_on_submit": 0, "label": "Customer Contact",
"bold": 0, "read_only": 1
"collapsible": 0, },
"columns": 0,
"fieldname": "customer_contact",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer Contact",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_9",
"allow_in_quick_entry": 0, "fieldtype": "Section Break",
"allow_on_submit": 0, "label": "Dispatch Information"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_9",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Dispatch Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "distance",
"allow_in_quick_entry": 0, "fieldtype": "Float",
"allow_on_submit": 0, "label": "Distance",
"bold": 0, "precision": "2",
"collapsible": 0, "read_only": 1
"columns": 0, },
"fieldname": "distance",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Distance",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "2",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "estimated_arrival",
"allow_in_quick_entry": 0, "fieldtype": "Datetime",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Estimated Arrival"
"collapsible": 0, },
"columns": 0,
"fieldname": "estimated_arrival",
"fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Estimated Arrival",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "lat",
"allow_in_quick_entry": 0, "fieldtype": "Float",
"allow_on_submit": 0, "hidden": 1,
"bold": 0, "label": "Latitude"
"collapsible": 0, },
"columns": 0,
"fieldname": "lat",
"fieldtype": "Float",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Latitude",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_19",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_19",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "depends_on": "eval:doc.distance",
"allow_in_quick_entry": 0, "fieldname": "uom",
"allow_on_submit": 0, "fieldtype": "Link",
"bold": 0, "label": "UOM",
"collapsible": 0, "options": "UOM",
"columns": 0, "read_only": 1
"default": "", },
"depends_on": "eval:doc.distance",
"fieldname": "uom",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "UOM",
"length": 0,
"no_copy": 0,
"options": "UOM",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "lng",
"allow_in_quick_entry": 0, "fieldtype": "Float",
"allow_on_submit": 0, "hidden": 1,
"bold": 0, "label": "Longitude"
"collapsible": 0, },
"columns": 0,
"fieldname": "lng",
"fieldtype": "Float",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Longitude",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "more_information_section",
"allow_in_quick_entry": 0, "fieldtype": "Section Break",
"allow_on_submit": 0, "label": "More Information"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fieldname": "more_information_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "More Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "details",
"allow_in_quick_entry": 0, "fieldtype": "Text Editor",
"allow_on_submit": 0, "label": "Details"
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "details",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Details",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "istable": 1,
"hide_heading": 0, "links": [],
"hide_toolbar": 0, "modified": "2023-09-29 09:22:53.435161",
"idx": 0, "modified_by": "Administrator",
"image_view": 0, "module": "Stock",
"in_create": 0, "name": "Delivery Stop",
"is_submittable": 0, "owner": "Administrator",
"issingle": 0, "permissions": [],
"istable": 1, "quick_entry": 1,
"max_attachments": 0, "sort_field": "modified",
"modified": "2018-10-16 05:23:25.661542", "sort_order": "DESC",
"modified_by": "Administrator", "states": [],
"module": "Stock", "track_changes": 1
"name": "Delivery Stop",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
} }

View File

@ -64,6 +64,11 @@ frappe.ui.form.on('Delivery Trip', {
}) })
}, __("Get stops from")); }, __("Get stops from"));
} }
frm.add_custom_button(__("Delivery Notes"), function () {
frappe.set_route("List", "Delivery Note",
{'name': ["in", frm.doc.delivery_stops.map((stop) => {return stop.delivery_note;})]}
);
}, __("View"));
}, },
calculate_arrival_time: function (frm) { calculate_arrival_time: function (frm) {

View File

@ -170,7 +170,7 @@ class DeliveryTrip(Document):
for stop in self.delivery_stops: for stop in self.delivery_stops:
leg.append(stop.customer_address) leg.append(stop.customer_address)
if optimize and stop.lock: if optimize and stop.locked:
route_list.append(leg) route_list.append(leg)
leg = [stop.customer_address] leg = [stop.customer_address]

View File

@ -46,7 +46,7 @@ class TestDeliveryTrip(FrappeTestCase):
self.assertEqual(len(route_list[0]), 4) self.assertEqual(len(route_list[0]), 4)
def test_unoptimized_route_list_with_locks(self): def test_unoptimized_route_list_with_locks(self):
self.delivery_trip.delivery_stops[0].lock = 1 self.delivery_trip.delivery_stops[0].locked = 1
self.delivery_trip.save() self.delivery_trip.save()
route_list = self.delivery_trip.form_route_list(optimize=False) route_list = self.delivery_trip.form_route_list(optimize=False)
@ -65,7 +65,7 @@ class TestDeliveryTrip(FrappeTestCase):
self.assertEqual(len(route_list[0]), 4) self.assertEqual(len(route_list[0]), 4)
def test_optimized_route_list_with_locks(self): def test_optimized_route_list_with_locks(self):
self.delivery_trip.delivery_stops[0].lock = 1 self.delivery_trip.delivery_stops[0].locked = 1
self.delivery_trip.save() self.delivery_trip.save()
route_list = self.delivery_trip.form_route_list(optimize=True) route_list = self.delivery_trip.form_route_list(optimize=True)

View File

@ -255,7 +255,7 @@ class Item(Document):
# add item taxes from template # add item taxes from template
for d in template.get("taxes"): for d in template.get("taxes"):
self.append("taxes", {"item_tax_template": d.item_tax_template}) self.append("taxes", d)
# copy re-order table if empty # copy re-order table if empty
if not self.get("reorder_levels"): if not self.get("reorder_levels"):

View File

@ -6,7 +6,6 @@ frappe.ui.form.on("Item Price", {
frm.set_query("item_code", function() { frm.set_query("item_code", function() {
return { return {
filters: { filters: {
"disabled": 0,
"has_variants": 0 "has_variants": 0
} }
}; };

View File

@ -401,6 +401,7 @@ def make_purchase_order(source_name, target_doc=None, args=None):
["uom", "uom"], ["uom", "uom"],
["sales_order", "sales_order"], ["sales_order", "sales_order"],
["sales_order_item", "sales_order_item"], ["sales_order_item", "sales_order_item"],
["wip_composite_asset", "wip_composite_asset"],
], ],
"postprocess": update_item, "postprocess": update_item,
"condition": select_item, "condition": select_item,

View File

@ -37,6 +37,10 @@
"rate", "rate",
"col_break3", "col_break3",
"amount", "amount",
"accounting_details_section",
"expense_account",
"column_break_glru",
"wip_composite_asset",
"manufacture_details", "manufacture_details",
"manufacturer", "manufacturer",
"manufacturer_part_no", "manufacturer_part_no",
@ -50,11 +54,10 @@
"lead_time_date", "lead_time_date",
"sales_order", "sales_order",
"sales_order_item", "sales_order_item",
"col_break4",
"production_plan", "production_plan",
"material_request_plan_item", "material_request_plan_item",
"job_card_item", "job_card_item",
"col_break4",
"expense_account",
"section_break_46", "section_break_46",
"page_break" "page_break"
], ],
@ -454,13 +457,28 @@
"label": "Job Card Item", "label": "Job Card Item",
"no_copy": 1, "no_copy": 1,
"print_hide": 1 "print_hide": 1
},
{
"fieldname": "accounting_details_section",
"fieldtype": "Section Break",
"label": "Accounting Details"
},
{
"fieldname": "column_break_glru",
"fieldtype": "Column Break"
},
{
"fieldname": "wip_composite_asset",
"fieldtype": "Link",
"label": "WIP Composite Asset",
"options": "Asset"
} }
], ],
"idx": 1, "idx": 1,
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2023-05-07 20:23:31.250252", "modified": "2023-10-27 15:53:41.444236",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Material Request Item", "name": "Material Request Item",
@ -471,4 +489,4 @@
"sort_order": "DESC", "sort_order": "DESC",
"states": [], "states": [],
"track_changes": 1 "track_changes": 1
} }

View File

@ -1069,6 +1069,7 @@ def make_purchase_invoice(source_name, target_doc=None):
"is_fixed_asset": "is_fixed_asset", "is_fixed_asset": "is_fixed_asset",
"asset_location": "asset_location", "asset_location": "asset_location",
"asset_category": "asset_category", "asset_category": "asset_category",
"wip_composite_asset": "wip_composite_asset",
}, },
"postprocess": update_item, "postprocess": update_item,
"filter": lambda d: get_pending_qty(d)[0] <= 0 "filter": lambda d: get_pending_qty(d)[0] <= 0

View File

@ -658,7 +658,7 @@ class SerialandBatchBundle(Document):
if not available_batches: if not available_batches:
return return
available_batches = get_availabel_batches_qty(available_batches) available_batches = get_available_batches_qty(available_batches)
for batch_no in batches: for batch_no in batches:
if batch_no not in available_batches or available_batches[batch_no] < 0: if batch_no not in available_batches or available_batches[batch_no] < 0:
self.throw_error_message( self.throw_error_message(
@ -1074,7 +1074,7 @@ def get_auto_data(**kwargs):
return get_auto_batch_nos(kwargs) return get_auto_batch_nos(kwargs)
def get_availabel_batches_qty(available_batches): def get_available_batches_qty(available_batches):
available_batches_qty = defaultdict(float) available_batches_qty = defaultdict(float)
for batch in available_batches: for batch in available_batches:
available_batches_qty[batch.batch_no] += batch.qty available_batches_qty[batch.batch_no] += batch.qty
@ -1301,6 +1301,7 @@ def get_reserved_batches_for_pos(kwargs) -> dict:
"POS Invoice", "POS Invoice",
fields=[ fields=[
"`tabPOS Invoice Item`.batch_no", "`tabPOS Invoice Item`.batch_no",
"`tabPOS Invoice Item`.qty",
"`tabPOS Invoice`.is_return", "`tabPOS Invoice`.is_return",
"`tabPOS Invoice Item`.warehouse", "`tabPOS Invoice Item`.warehouse",
"`tabPOS Invoice Item`.name as child_docname", "`tabPOS Invoice Item`.name as child_docname",
@ -1321,9 +1322,6 @@ def get_reserved_batches_for_pos(kwargs) -> dict:
if pos_invoice.serial_and_batch_bundle if pos_invoice.serial_and_batch_bundle
] ]
if not ids:
return {}
if ids: if ids:
for d in get_serial_batch_ledgers(kwargs.item_code, docstatus=1, name=ids): for d in get_serial_batch_ledgers(kwargs.item_code, docstatus=1, name=ids):
key = (d.batch_no, d.warehouse) key = (d.batch_no, d.warehouse)
@ -1337,6 +1335,7 @@ def get_reserved_batches_for_pos(kwargs) -> dict:
else: else:
pos_batches[key].qty += d.qty pos_batches[key].qty += d.qty
# POS invoices having batch without bundle (to handle old POS invoices)
for row in pos_invoices: for row in pos_invoices:
if not row.batch_no: if not row.batch_no:
continue continue
@ -1346,11 +1345,11 @@ def get_reserved_batches_for_pos(kwargs) -> dict:
key = (row.batch_no, row.warehouse) key = (row.batch_no, row.warehouse)
if key in pos_batches: if key in pos_batches:
pos_batches[key] -= row.qty * -1 if row.is_return else row.qty pos_batches[key]["qty"] -= row.qty * -1 if row.is_return else row.qty
else: else:
pos_batches[key] = frappe._dict( pos_batches[key] = frappe._dict(
{ {
"qty": (row.qty * -1 if row.is_return else row.qty), "qty": (row.qty * -1 if not row.is_return else row.qty),
"warehouse": row.warehouse, "warehouse": row.warehouse,
} }
) )

View File

@ -123,13 +123,6 @@ frappe.ui.form.on("Stock Reconciliation", {
fieldname: "item_code", fieldname: "item_code",
fieldtype: "Link", fieldtype: "Link",
options: "Item", options: "Item",
"get_query": function() {
return {
"filters": {
"disabled": 0,
}
};
}
}, },
{ {
label: __("Ignore Empty Stock"), label: __("Ignore Empty Stock"),

View File

@ -241,7 +241,7 @@ class StockReservationEntry(Document):
if available_qty_to_reserve <= 0: if available_qty_to_reserve <= 0:
msg = _( msg = _(
"Row #{0}: Stock not availabe to reserve for Item {1} against Batch {2} in Warehouse {3}." "Row #{0}: Stock not available to reserve for Item {1} against Batch {2} in Warehouse {3}."
).format( ).format(
entry.idx, entry.idx,
frappe.bold(self.item_code), frappe.bold(self.item_code),

View File

@ -268,7 +268,7 @@ def get_basic_details(args, item, overwrite_warehouse=True):
if not item: if not item:
item = frappe.get_doc("Item", args.get("item_code")) item = frappe.get_doc("Item", args.get("item_code"))
if item.variant_of: if item.variant_of and not item.taxes:
item.update_template_tables() item.update_template_tables()
item_defaults = get_item_defaults(item.name, args.company) item_defaults = get_item_defaults(item.name, args.company)
@ -330,8 +330,12 @@ def get_basic_details(args, item, overwrite_warehouse=True):
), ),
"expense_account": expense_account "expense_account": expense_account
or get_default_expense_account(args, item_defaults, item_group_defaults, brand_defaults), or get_default_expense_account(args, item_defaults, item_group_defaults, brand_defaults),
"discount_account": get_default_discount_account(args, item_defaults), "discount_account": get_default_discount_account(
"provisional_expense_account": get_provisional_account(args, item_defaults), args, item_defaults, item_group_defaults, brand_defaults
),
"provisional_expense_account": get_provisional_account(
args, item_defaults, item_group_defaults, brand_defaults
),
"cost_center": get_default_cost_center( "cost_center": get_default_cost_center(
args, item_defaults, item_group_defaults, brand_defaults args, item_defaults, item_group_defaults, brand_defaults
), ),
@ -686,12 +690,22 @@ def get_default_expense_account(args, item, item_group, brand):
) )
def get_provisional_account(args, item): def get_provisional_account(args, item, item_group, brand):
return item.get("default_provisional_account") or args.default_provisional_account return (
item.get("default_provisional_account")
or item_group.get("default_provisional_account")
or brand.get("default_provisional_account")
or args.default_provisional_account
)
def get_default_discount_account(args, item): def get_default_discount_account(args, item, item_group, brand):
return item.get("default_discount_account") or args.discount_account return (
item.get("default_discount_account")
or item_group.get("default_discount_account")
or brand.get("default_discount_account")
or args.discount_account
)
def get_default_deferred_account(args, item, fieldname=None): def get_default_deferred_account(args, item, fieldname=None):

View File

@ -1,13 +1,6 @@
frappe.ui.form.on("Issue", { frappe.ui.form.on("Issue", {
onload: function(frm) { onload: function(frm) {
frm.email_field = "raised_by"; frm.email_field = "raised_by";
frm.set_query("customer", function () {
return {
filters: {
"disabled": 0
}
};
});
frappe.db.get_value("Support Settings", {name: "Support Settings"}, frappe.db.get_value("Support Settings", {name: "Support Settings"},
["allow_resetting_service_level_agreement", "track_service_level_agreement"], (r) => { ["allow_resetting_service_level_agreement", "track_service_level_agreement"], (r) => {