From 1068d0ec63f7e240b08d52426dac3216826fdbcc Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sat, 24 Dec 2022 18:11:04 +0530 Subject: [PATCH 1/3] fix: `shipping_address` in PO (cherry picked from commit 7e1b6b3c2aa114331ad9085cfefee340b8ca2ad0) # Conflicts: # erpnext/buying/doctype/purchase_order/purchase_order.json --- .../purchase_order/purchase_order.json | 151 +++++++++++++++++- .../doctype/sales_order/sales_order.py | 6 +- 2 files changed, 153 insertions(+), 4 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 2144ae00366..12ad27f0d53 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -113,6 +113,43 @@ "disable_rounded_total", "in_words", "advance_paid", +<<<<<<< HEAD +======= + "discount_section", + "apply_discount_on", + "base_discount_amount", + "column_break_45", + "additional_discount_percentage", + "discount_amount", + "sec_tax_breakup", + "other_charges_calculation", + "address_and_contact_tab", + "section_addresses", + "supplier_address", + "address_display", + "col_break_address", + "contact_person", + "contact_display", + "contact_mobile", + "contact_email", + "shipping_address_section", + "shipping_address", + "column_break_99", + "shipping_address_display", + "company_billing_address_section", + "billing_address", + "column_break_103", + "billing_address_display", + "drop_ship", + "customer", + "customer_name", + "column_break_19", + "customer_contact_person", + "customer_contact_display", + "customer_contact_mobile", + "customer_contact_email", + "terms_tab", +>>>>>>> 7e1b6b3c2a (fix: `shipping_address` in PO) "payment_schedule_section", "payment_terms_template", "payment_schedule", @@ -370,7 +407,7 @@ { "fieldname": "shipping_address", "fieldtype": "Link", - "label": "Company Shipping Address", + "label": "Shipping Address", "options": "Address", "print_hide": 1 }, @@ -1164,13 +1201,125 @@ "fieldtype": "Link", "label": "Project", "options": "Project" +<<<<<<< HEAD +======= + }, + { + "default": "0", + "fieldname": "is_old_subcontracting_flow", + "fieldtype": "Check", + "hidden": 1, + "label": "Is Old Subcontracting Flow", + "read_only": 1 + }, + { + "depends_on": "is_internal_supplier", + "fieldname": "set_from_warehouse", + "fieldtype": "Link", + "label": "Set From Warehouse", + "options": "Warehouse" + }, + { + "fieldname": "terms_tab", + "fieldtype": "Tab Break", + "label": "Terms" + }, + { + "fieldname": "more_info_tab", + "fieldtype": "Tab Break", + "label": "More Info" + }, + { + "fieldname": "dashboard", + "fieldtype": "Tab Break", + "label": "Dashboard", + "show_dashboard": 1 + }, + { + "fieldname": "column_break_7", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_40", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_53", + "fieldtype": "Column Break" + }, + { + "fieldname": "address_and_contact_tab", + "fieldtype": "Tab Break", + "label": "Address & Contact" + }, + { + "fieldname": "company_billing_address_section", + "fieldtype": "Section Break", + "label": "Company Billing Address" + }, + { + "collapsible": 1, + "fieldname": "additional_info_section", + "fieldtype": "Section Break", + "label": "Additional Info", + "oldfieldtype": "Section Break" + }, + { + "default": "0", + "fieldname": "tax_withholding_net_total", + "fieldtype": "Currency", + "hidden": 1, + "label": "Tax Withholding Net Total", + "no_copy": 1, + "options": "currency", + "read_only": 1 + }, + { + "fieldname": "base_tax_withholding_net_total", + "fieldtype": "Currency", + "hidden": 1, + "label": "Base Tax Withholding Net Total", + "no_copy": 1, + "options": "currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_99", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_103", + "fieldtype": "Column Break" + }, + { + "fieldname": "incoterm", + "fieldtype": "Link", + "label": "Incoterm", + "options": "Incoterm" + }, + { + "depends_on": "incoterm", + "fieldname": "named_place", + "fieldtype": "Data", + "label": "Named Place" + }, + { + "fieldname": "shipping_address_section", + "fieldtype": "Section Break", + "label": "Shipping Address" +>>>>>>> 7e1b6b3c2a (fix: `shipping_address` in PO) } ], "icon": "fa fa-file-text", "idx": 105, "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2022-11-17 12:34:36.033363", +======= + "modified": "2022-12-25 18:08:59.074182", +>>>>>>> 7e1b6b3c2a (fix: `shipping_address` in PO) "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 303e4fff4af..6b624c2421f 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -1097,8 +1097,6 @@ def make_purchase_order(source_name, selected_items=None, target_doc=None): target.discount_amount = 0.0 target.inter_company_order_reference = "" target.shipping_rule = "" - target.customer = "" - target.customer_name = "" target.run_method("set_missing_values") target.run_method("calculate_taxes_and_totals") @@ -1125,9 +1123,11 @@ def make_purchase_order(source_name, selected_items=None, target_doc=None): "contact_email", "contact_person", "taxes_and_charges", - "shipping_address", "terms", ], + "field_map": [ + ["shipping_address_name", "shipping_address"], + ], "validation": {"docstatus": ["=", 1]}, }, "Sales Order Item": { From 91dad909ec5676e087e3a0312a5482ac9940d4e6 Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sun, 25 Dec 2022 21:40:49 +0530 Subject: [PATCH 2/3] chore: conflicts --- .../purchase_order/purchase_order.json | 149 ------------------ 1 file changed, 149 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 12ad27f0d53..6358896e7dc 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -113,43 +113,6 @@ "disable_rounded_total", "in_words", "advance_paid", -<<<<<<< HEAD -======= - "discount_section", - "apply_discount_on", - "base_discount_amount", - "column_break_45", - "additional_discount_percentage", - "discount_amount", - "sec_tax_breakup", - "other_charges_calculation", - "address_and_contact_tab", - "section_addresses", - "supplier_address", - "address_display", - "col_break_address", - "contact_person", - "contact_display", - "contact_mobile", - "contact_email", - "shipping_address_section", - "shipping_address", - "column_break_99", - "shipping_address_display", - "company_billing_address_section", - "billing_address", - "column_break_103", - "billing_address_display", - "drop_ship", - "customer", - "customer_name", - "column_break_19", - "customer_contact_person", - "customer_contact_display", - "customer_contact_mobile", - "customer_contact_email", - "terms_tab", ->>>>>>> 7e1b6b3c2a (fix: `shipping_address` in PO) "payment_schedule_section", "payment_terms_template", "payment_schedule", @@ -1201,125 +1164,13 @@ "fieldtype": "Link", "label": "Project", "options": "Project" -<<<<<<< HEAD -======= - }, - { - "default": "0", - "fieldname": "is_old_subcontracting_flow", - "fieldtype": "Check", - "hidden": 1, - "label": "Is Old Subcontracting Flow", - "read_only": 1 - }, - { - "depends_on": "is_internal_supplier", - "fieldname": "set_from_warehouse", - "fieldtype": "Link", - "label": "Set From Warehouse", - "options": "Warehouse" - }, - { - "fieldname": "terms_tab", - "fieldtype": "Tab Break", - "label": "Terms" - }, - { - "fieldname": "more_info_tab", - "fieldtype": "Tab Break", - "label": "More Info" - }, - { - "fieldname": "dashboard", - "fieldtype": "Tab Break", - "label": "Dashboard", - "show_dashboard": 1 - }, - { - "fieldname": "column_break_7", - "fieldtype": "Column Break" - }, - { - "fieldname": "column_break_40", - "fieldtype": "Column Break" - }, - { - "fieldname": "column_break_53", - "fieldtype": "Column Break" - }, - { - "fieldname": "address_and_contact_tab", - "fieldtype": "Tab Break", - "label": "Address & Contact" - }, - { - "fieldname": "company_billing_address_section", - "fieldtype": "Section Break", - "label": "Company Billing Address" - }, - { - "collapsible": 1, - "fieldname": "additional_info_section", - "fieldtype": "Section Break", - "label": "Additional Info", - "oldfieldtype": "Section Break" - }, - { - "default": "0", - "fieldname": "tax_withholding_net_total", - "fieldtype": "Currency", - "hidden": 1, - "label": "Tax Withholding Net Total", - "no_copy": 1, - "options": "currency", - "read_only": 1 - }, - { - "fieldname": "base_tax_withholding_net_total", - "fieldtype": "Currency", - "hidden": 1, - "label": "Base Tax Withholding Net Total", - "no_copy": 1, - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break_99", - "fieldtype": "Column Break" - }, - { - "fieldname": "column_break_103", - "fieldtype": "Column Break" - }, - { - "fieldname": "incoterm", - "fieldtype": "Link", - "label": "Incoterm", - "options": "Incoterm" - }, - { - "depends_on": "incoterm", - "fieldname": "named_place", - "fieldtype": "Data", - "label": "Named Place" - }, - { - "fieldname": "shipping_address_section", - "fieldtype": "Section Break", - "label": "Shipping Address" ->>>>>>> 7e1b6b3c2a (fix: `shipping_address` in PO) } ], "icon": "fa fa-file-text", "idx": 105, "is_submittable": 1, "links": [], -<<<<<<< HEAD - "modified": "2022-11-17 12:34:36.033363", -======= "modified": "2022-12-25 18:08:59.074182", ->>>>>>> 7e1b6b3c2a (fix: `shipping_address` in PO) "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", From 820e82265bc00d2c08d8b2837915b5ebbfbd566e Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sun, 25 Dec 2022 21:46:58 +0530 Subject: [PATCH 3/3] chore: linter --- erpnext/stock/doctype/stock_entry/stock_entry.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index d53f4cdbac9..b27abae513e 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -10,7 +10,6 @@ import frappe from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.query_builder.functions import Sum -from six import iteritems, itervalues, string_types from frappe.utils import ( add_days, cint, @@ -23,6 +22,7 @@ from frappe.utils import ( nowdate, today, ) +from six import iteritems, itervalues, string_types import erpnext from erpnext.accounts.general_ledger import process_gl_map @@ -2625,4 +2625,3 @@ def get_incorrect_stock_entries() -> Dict: stock_entries.setdefault(row.name, row) return stock_entries -