Conversion Factor in Purchase Invoice is read-only

This was mentioned here but nothing was done and the thread was closed:

This is still an issue in v11. Inputting either Qty or UOM first does NOT enable the Conversion Factor.

Why is this not set to 1 by default? Under what circumstances would you add a row to a purchase invoice and have the conversion factor set to zero? It just makes no sense. And clearly, a Conversion Factor set to zero is invalid, otherwise it would cough out “Row 1: Conversion Factor is mandatory”.

2 Likes

I ended up fixing this by customizing the doctype, and changing the conversion factor default to 1. It’s a pretty nasty bug, though. 4 out of 4 companies I’ve recommended ERPNext to came back to me saying they gave up because of this error.

It’s a pretty trivial fix, but I don’t feel like I have enough of an understanding of why it was designed this way to submit a pull request.

Thanks for the reply. I too found references on this forum to changing the default value to 1, however when I looked at purchase invoices in Customise Forms I could not find a reference to it in any of the values. There were over 100 other configuration parameters but no conversation factor.

Where would I change the default? Thanks for your help.

Nobody knows where to set this? I have issues with every item because of this.

My apologies that thread I reopened just now.

“It’s a pretty nasty bug, though. 4 out of 4 companies I’ve recommended ERPNext to came back to me saying they gave up because of this error.”

Please report this issue on github.com and link to this discussion here.

Good call, and I don’t know why I didn’t do that earlier. Anyway, The issue appears to be fixed now with v11, but if anybody notices otherwise please post here and I can file the bug report.

@ChipwizBen - Apologies, I missed your response posts somehow. UoM seems to be editable now, but for future reference you can change default values through the Customize Doctype form.

Yes to report bugs here on discuss is a start, but best check and record it here if you are serious Issues · frappe/erpnext · GitHub

That said more advances and the odd bug too afoot :slight_smile:

Since this is still broken in V11 Prod, can you please describe how you changed the default value for Conversion Factor from 0 to 1? I’ve got as far as this:

https://domain/desk#Form/DocType/Purchase%20Invoice%20Item

In there (line 15) is UOM Conversion Factor (conversion_factor) which I believe is the correct field from the Purchase Invoice table. But it is not possible to edit any values in there (such as uncheck “Read Only”) nor do I see anywhere to set the default value.

Can you please explain where to change the default? Thank you.

UOM Conversion Factor is read-only and set to zero by default:

You CANNOT save the invoice because the Conversion Factor needs to be > 0.
CF

It appears that you’re trying to edit the doctype directly, but that’s not the right approach here (nor even possible in production mode). You need to use the “Customize Form” tool, available in search, and customize the Purchase Invoice document that way.

I feel like this is going around in circles. I found Conversion Factor not under Purchase Invoice, but under Stock Entry Detail. Even there, I could still not see where to set the default value. When trying to uncheck “Read Only” and updating it, it gives this error:

“You cannot unset ‘Read Only’ for field Conversion Factor”

Edit: I found a second Conversion Factor under Purchase Invoice Item. This also gives the same error.

Right, that’s expected behavior (though the error message could certainly be a lot clearer). The conversion factor is not intended to be set manually at the moment. You wouldn’t want to change that on a production system. The results would be unpredictable.

You should, however, be able to change the default to 1, which is the appropriate value for one-off (non-item) lines on a purchase invoice.

If you still struggling: Set

Customize Form -> Purchase Invoice Item -> UOM Conversion Factor -> Default

to 1.