[fixes] pull customer details only if drop shipping is marked
This commit is contained in:
parent
45a8f9d006
commit
f6891975d5
@ -534,6 +534,7 @@ def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc=
|
|||||||
if default_price_list:
|
if default_price_list:
|
||||||
target.buying_price_list = default_price_list
|
target.buying_price_list = default_price_list
|
||||||
|
|
||||||
|
if any( item.delivered_by_supplier==1 for item in source.items):
|
||||||
if source.shipping_address_name:
|
if source.shipping_address_name:
|
||||||
target.customer_address = source.shipping_address_name
|
target.customer_address = source.shipping_address_name
|
||||||
target.customer_address_display = source.shipping_address
|
target.customer_address_display = source.shipping_address
|
||||||
@ -541,6 +542,15 @@ def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc=
|
|||||||
target.customer_address = source.customer_address
|
target.customer_address = source.customer_address
|
||||||
target.customer_address_display = source.address_display
|
target.customer_address_display = source.address_display
|
||||||
|
|
||||||
|
target.customer_contact_person = source.contact_person
|
||||||
|
target.customer_contact_display = source.contact_display
|
||||||
|
target.customer_contact_mobile = source.contact_mobile
|
||||||
|
target.customer_contact_email = source.contact_email
|
||||||
|
|
||||||
|
else:
|
||||||
|
target.customer = ""
|
||||||
|
target.customer_name = ""
|
||||||
|
|
||||||
target.run_method("set_missing_values")
|
target.run_method("set_missing_values")
|
||||||
target.run_method("calculate_taxes_and_totals")
|
target.run_method("calculate_taxes_and_totals")
|
||||||
|
|
||||||
@ -551,12 +561,6 @@ def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc=
|
|||||||
doclist = get_mapped_doc("Sales Order", source_name, {
|
doclist = get_mapped_doc("Sales Order", source_name, {
|
||||||
"Sales Order": {
|
"Sales Order": {
|
||||||
"doctype": "Purchase Order",
|
"doctype": "Purchase Order",
|
||||||
"field_map": {
|
|
||||||
"contact_person": "customer_contact_person",
|
|
||||||
"contact_display": "customer_contact_display",
|
|
||||||
"contact_mobile": "customer_contact_mobile",
|
|
||||||
"contact_email": "customer_contact_email",
|
|
||||||
},
|
|
||||||
"field_no_map": [
|
"field_no_map": [
|
||||||
"address_display",
|
"address_display",
|
||||||
"contact_display",
|
"contact_display",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user