Updated Model Design Guidelines (markdown)

Rushabh Mehta
2018-11-08 12:08:39 +05:30
parent 8f284783de
commit f3b1c96fed

@@ -1,3 +1,9 @@
### Avoid hard coding of Roles
No business logic should be based on hard coded roles. Either make it a configuration or set a property in User / Employee whether user has the permission to do the action.
No business logic should be based on hard coded roles. Either make it a configuration or set a property in User / Employee whether user has the permission to do the action.
### Make Contextual Settings
Sometimes to change the default behaviour of a transaction, a developer adds a global setting to allow it to behave in one way or another. These settings are hard to discover and hence must be avoided. Either these settings must be changeable at the transaction level with a Check type field, in the context.
Example if you want to allow Orders and Invoice of different Currencies, don't make a global "Allow Invoice in a Separate Currency". The better design is to make a Check in the Sales Order to allow an invoice in a different currency. Even better, just ask the user to make a duplicate Sales Order and change the older one if the customer demands the invoice in another currency.