'Select Shipping Address' field in Purchase Invoice doesn't list the addresses

While creating a new purchase invoice, the ‘Address and Contact’ section has a field ‘Select Shipping Address’. If no value is selected then the Place of Supply is taken default as that of the supplier and the Company GSTN is not populated as it takes the value from the shipping_address.

Hence I had created the company billing and shipping addresses through the Addresses module and even through Company → Company Info, wherein I could enter the GSTN details as well as the State code.

Yet when creating a purchase invoice, the ‘Select Shipping Address’ does not enlist any of the existing addresses in the system. Have I stumbled upon a bug?

If not, how can I ensure that the default shipping address selected is that of the Company? Is there a way I can set the default value as company.shipping_address or something similar.

Please guide me to any documentation available in this regards.

P.S. I have only one Company defined.

1 Like

Ideally you should be getting a list of addresses associated with a company

In case there is a default address for the company (shipping or billing), just check the Preferred Address checkbox.

@kennethsequeira I agree to the ideal scenario. What I am stating is specific to purchase invoice. I have verified in my trial account at ERPNext Cloud as well and have found the same issue there. No addresses are being listed in the Select Shipping Address field. However, Select Supplier Address is working fine.

And yes, I have ensured that Preferred Billing/Shipping Address is selected for the respective Company addresses.

Figured it out.

An address requires Is Your Company Address to be checked in the Address - Reference section for it to be tagged as a special address linked to a Company and thereafter it is auto-populated when creating a purchase invoice.

Yet the Preferred Billing Address auto-selected instead of the Preferred Shipping Address for the Select Shipping Address field. So it still seems a bug. If confirmed, I shall create a github issue.

1 Like

Just tried to replicate this.

In my case my default shipping address was fetched directly. Check in case you have ticked on more than one address as Preferred Shipping address by any chance.

Have not. Could you check if your shipping address is listed as the first one by default, thus returning as the first in the query for it. Try swapping your addresses and see if that makes a difference. I shall also try juggling them around at my end and revert in a while.

Couldn’t replicate. I did swap my addresses.

Whichever Company address I save last shows up in the Select field automatically. Confirmed over 5 trials.
So seems to be that last_update_timestamp of something similar is playing its part.

Do try this and let me know pls.

Then it would be best to create a GitHub issue for this and let others validate as well.

https://github.com/frappe/erpnext/issues/13961

This bug is still around on the purchase invoice, is there any progress on this? I have orders that are being drop shipped to the customer, and I need the Customer’s address on the purchase invoice. If not, how would I go about fixing this?

1 Like

Any update on this? It’s still a bug in ERPNext v10.1.76.

The issue isn’t linking a shipping address for the company, it’s for selecting a different ship to address. I.e: we order parts from one Supplier to be shipped to another Supplier.

I’ve already tested this with Items in the system. Having them selected as “Drop shipped by Supplier” makes no difference here.

The quickest solution we found was to just add a new field to the Supplier DocType (Link → Address). Then, the user can select any variety of address in the system. You’ll have to manually update your print templates to reference this field, but there is now no restriction on what addresses are selectable.