Can't approve PO

I have a strange issue. I can’t approve PO’s with my admin account. Even i I set the approver permission to my account. I get the error:

Did you change the default role types configuration property in openboxes-config.*?

The default setting looks like this.

openboxes.purchasing.approval.defaultRoleTypes = [RoleType.ROLE_APPROVER]

Also make sure that the Approver role has Role Type = ROLE_APPROVER.

I have:

// Require approval on purchase orders
openboxes.purchasing.approval.enabled = true
openboxes.purchasing.approval.minimumAmount = 0.00
openboxes.purchasing.approval.defaultRoleTypes = [RoleType.ROLE_APPROVER]

And my account has the role Approver:

Firefox_Screenshot_2022-02-05T08-04-11.518Z

If I set

openboxes.purchasing.approval.enabled = false

Then it works.

In what file do you have these config settings?

// Require approval on purchase orders
openboxes.purchasing.approval.enabled = true
openboxes.purchasing.approval.minimumAmount = 0.00
openboxes.purchasing.approval.defaultRoleTypes = [RoleType.ROLE_APPROVER]

Can you create a bug report (https://github.com/openboxes/openboxes/issues) and record a video so I can see the full screen (there are details missing from the screenshot that might be important for debugging)? Show me the Edit User page and then walk through the Create PO workflow.

1 Like

So I made a record :slight_smile:screen recorder thu feb 17 2022 20 22 09 - YouTube

Thanks, David. I am also curious about your configuration files (i.e. openboxes-config.properties and openboxes-config.groovy). Can you send those to me (minus the sensitive properties like passwords) via support@openboxes.com.

I did, from ddouma@xxxxxxx.nl. I deleted all email and password info in the files :).

So the first thing I noticed was that you included the most of the properties from the Config.groovy file. I would caution against this and only override the values you need to override.

Secondly, the defaultRoleTypes is set to RoleType.ROLE_ADMIN instead of RoleType.ROLE_APPROVER (or whatever we use).

// Require approval on purchase orders
openboxes.purchasing.approval.enabled = true
openboxes.purchasing.approval.minimumAmount = 0.00
openboxes.purchasing.approval.defaultRoleTypes = [RoleType.ROLE_ADMIN]

The third issue is that the Config.groovy file includes an import for RoleType. Your openboxes-config.groovy does not.

import org.pih.warehouse.core.RoleType

The following config should work.

// Require approval on purchase orders
openboxes.purchasing.approval.enabled = true
openboxes.purchasing.approval.minimumAmount = 0.00
openboxes.purchasing.approval.defaultRoleTypes = [org.pih.warehouse.core.RoleType.ROLE_ADMIN]

Or you can import at the top of the file

import org.pih.warehouse.core.RoleType

...

// Require approval on purchase orders
openboxes.purchasing.approval.enabled = true
openboxes.purchasing.approval.minimumAmount = 0.00
openboxes.purchasing.approval.defaultRoleTypes = [RoleType.ROLE_APPROVER]