feat: Add Delivery Address field to Purchase Orders#9768
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
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. |
|
@Reza98Sh there is a conflict in the migrations; please delete the ones you added and regenerate them |
matmair
left a comment
There was a problem hiding this comment.
Looks very good for a first PR
|
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? |
f87e685 to
a36d430
Compare
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:
Having (1 or more) internal companies as references would be nice for a few of the open EPICs. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This PR seems stale. Please react to show this is still important. |
|
Still relevant |
|
@Reza98Sh I'm moving this to the |
|
I have the need to add our own company in the header for Sales Ordrers and found this PR. Would it make sense to make it generic and create an internal company how "owns" the database and expose the same to all reports? I can see the need also for other kind of reports (e.g. stock reports) where it would be beneficial if the report included the company it's valid for in the header. |

This pull request implements the feature requested in #9303 by adding a dedicated
delivery_addressfield to Purchase Orders.Changes Implemented
Backend:
0110_purchaseorder_delivery_address.py) to apply the schema change.delivery_addressForeignKeyfield to thePurchaseOrdermodel, linking tocompany.Address.delivery_addressfield in thePurchaseOrderSerializerto make it available via the API.delivery_addressin theautocomplete_fieldsinPurchaseOrderAdminfor a better user experience in the admin panel.Frontend:
delivery_addressfield to theusePurchaseOrderFieldshook, making it visible and editable in the Purchase Order forms.Closes #9303