OBGM-469 Fix generating product code#4124
OBGM-469 Fix generating product code#4124awalkowiak merged 2 commits intofeature/upgrade-to-grails-3.3.10from
Conversation
jmiranda
left a comment
There was a problem hiding this comment.
Nothing specific to address other than maybe thinking about the render -> redirect change. Not sure if that's the behavior we want for the unhappy case.
grails-app/controllers/org/pih/warehouse/product/ProductController.groovy
Show resolved
Hide resolved
|
|
||
| def beforeInsert = { | ||
| def beforeInsert() { | ||
| createdBy = AuthService.currentUser |
There was a problem hiding this comment.
In the Shipment domain I changed the convention to include updatedBy in the insert as well. I had assumed we were already doing this everywhere else but it looks like I was wrong.
Topics for tech-huddle maybe:
- Do you think that should be applied everywhere?
- If so do you think we can move this to a generic solution
- Auditable abstract class or trait (assuming that's what traits are for) that adds these methods to domains that have these audit fields?
The first of these could be done during MVP1, but the other points should be MVP2/post-migration.
Now that we might have more consistency with the Grails 3 dirty properties API we could also try to make these persistence events more fine-grained. There are only a few properties on Product that should cause a refresh to InventorySnapshot. Same with other domains for ProductAvailability.
| } | ||
|
|
||
| render(view: "edit", model: [productInstance: productInstance, rootCategory: productService.getRootCategory(), locationInstance: location]) | ||
| redirect(action: "edit", params: [id: productInstance.id]) |
There was a problem hiding this comment.
You're right... I'll restore this
…n product instance
No description provided.