From dcf2d3532e33d4d385b8539c20b108907d5a1b71 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 17 Jul 2019 19:28:36 +0530 Subject: [PATCH 1/2] fix: address and taxes not set as per pos profile in the pos invoice --- .../accounts/doctype/sales_invoice/sales_invoice.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 88ad6b37db..46913dc3af 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -395,14 +395,18 @@ class SalesInvoice(SellingController): if pos.get('account_for_change_amount'): self.account_for_change_amount = pos.get('account_for_change_amount') - for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name', - 'company', 'select_print_heading', 'cash_bank_account', 'company_address', - 'write_off_account', 'write_off_cost_center', 'apply_discount_on', 'cost_center'): + for fieldname in ('territory', 'naming_series', 'currency', 'letter_head', 'tc_name', + 'company', 'select_print_heading', 'cash_bank_account', 'write_off_account', + 'write_off_cost_center', 'apply_discount_on', 'cost_center'): if (not for_validate) or (for_validate and not self.get(fieldname)): self.set(fieldname, pos.get(fieldname)) customer_price_list = frappe.get_value("Customer", self.customer, 'default_price_list') + for field in ['taxes_and_charges', 'company_address']: + if pos.get(field): + self.set(field, pos.get(fieldname)) + if not customer_price_list: self.set('selling_price_list', pos.get('selling_price_list')) From 9fe6e00a4e022e8b9d72c466d541d86c00247aaa Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 19 Jul 2019 07:54:08 +0530 Subject: [PATCH 2/2] fix: not able to make material request for bundle items from the sales order --- erpnext/selling/doctype/sales_order/sales_order.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 0c5188a4fe..09dc9a9932 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -509,10 +509,12 @@ def make_material_request(source_name, target_doc=None): doc.material_request_type = "Purchase" def update_item(source, target, source_parent): + # qty is for packed items, because packed items don't have stock_qty field + qty = source.get("stock_qty") or source.get("qty") target.project = source_parent.project - target.qty = source.stock_qty - requested_item_qty.get(source.name, 0) + target.qty = qty - requested_item_qty.get(source.name, 0) target.conversion_factor = 1 - target.stock_qty = source.stock_qty - requested_item_qty.get(source.name, 0) + target.stock_qty = qty - requested_item_qty.get(source.name, 0) doc = get_mapped_doc("Sales Order", source_name, { "Sales Order": {