feat: Add Delivery Address field to Purchase Orders
This pull request implements the feature requested in #9303 by adding a dedicated delivery_address field to Purchase Orders.
Changes Implemented
Backend:
- [x] Created a new database migration (
0110_purchaseorder_delivery_address.py) to apply the schema change. - [x] Added a
delivery_addressForeignKeyfield to thePurchaseOrdermodel, linking tocompany.Address. - [x] Exposed the
delivery_addressfield in thePurchaseOrderSerializerto make it available via the API. - [x] Included
delivery_addressin theautocomplete_fieldsinPurchaseOrderAdminfor a better user experience in the admin panel.
Frontend:
- [x] Added the
delivery_addressfield to theusePurchaseOrderFieldshook, making it visible and editable in the Purchase Order forms.
Closes #9303
Deploy Preview for inventree-web-pui-preview ready!
| Name | Link |
|---|---|
| Latest commit | eba545e67d54540b99eee5f041f0509fb0a6483f |
| Latest deploy log | https://app.netlify.com/projects/inventree-web-pui-preview/deploys/68e10bd30e3e580008bc1539 |
| Deploy Preview | https://deploy-preview-9768--inventree-web-pui-preview.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
Lighthouse |
1 paths audited Performance: 94 (🔴 down 1 from production) Accessibility: 81 (no change from production) Best Practices: 100 (no change from production) SEO: 78 (no change from production) PWA: - View the detailed breakdown and full score reports |
To edit notification comments on pull requests, go to your Netlify project configuration.
If this method is not considered best practice, please let me know. I am doing my best to improve it.
@Reza98Sh there is a conflict in the migrations; please delete the ones you added and regenerate them
An implementation question: where / how do the users define an address for "themself" which can be used here?
One approach might be to create a "company" object which is the "internal" company, which can then have one or more addresses associated with it?
Any other ideas?
An implementation question: where / how do the users define an address for "themself" which can be used here?
One approach might be to create a "company" object which is the "internal" company, which can then have one or more addresses associated with it?
Any other ideas?
Sorry I haven't any serious experience with InvenTree but I think It's good if there is option to create address without define company
@matmair thoughts on this? Does a set of "internal addresses" for "me" (which are not linked to a company object) make the most sense?
There is no real inherent connection between Addresses and Companies but the way the current data model works there are a few functions that would need rethinking.
Mainly:
- shipping notes
- primary addresses
Having (1 or more) internal companies as references would be nice for a few of the open EPICs. My suggestion for now: creating a special "locked/protected" company that represents the org that owns the InvenTree instance and link the addresses there.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 86.34%. Comparing base (
b465900) to head (3980b67).
Additional details and impacted files
@@ Coverage Diff @@
## master #9768 +/- ##
=======================================
Coverage 86.34% 86.34%
=======================================
Files 1234 1235 +1
Lines 54239 54245 +6
Branches 2236 2236
=======================================
+ Hits 46830 46839 +9
+ Misses 6841 6838 -3
Partials 568 568
| Flag | Coverage Δ | |
|---|---|---|
| backend | 88.26% <100.00%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
This PR seems stale. Please react to show this is still important.
Still relevant
@Reza98Sh I'm moving this to the 1.2.0 release target - there are still some questions to address here, I will get back to review this soon
