-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use max function to get default company address #34116
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #34116 +/- ##
===========================================
- Coverage 64.09% 63.89% -0.20%
===========================================
Files 810 817 +7
Lines 59372 59337 -35
===========================================
- Hits 38052 37912 -140
- Misses 21320 21425 +105
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍🏼
Could you add a test case in test_company.py
to make sure this doesn't happen again?
@prateekkaramchandani This looks like an essential fix, can you please add the tests? |
Looks like I broke this 😔 because cmp had x and y flipped and I got confused. |
#34452) * fix: use max function to get default company address (cherry picked from commit b93c18b) * test: add test for primary address sorting (cherry picked from commit e004297) --------- Co-authored-by: Prateek <40106895+prateekkaramchandani@users.noreply.github.com> Co-authored-by: Ankush Menat <ankush@frappe.io>
# [14.19.0](v14.18.3...v14.19.0) (2023-03-21) ### Bug Fixes * **client:** Amount calculation for 0 qty debit notes ([#34455](#34455)) ([d24f4d2](d24f4d2)) * difference amount calculation for company currency accounts ([9ab7bff](9ab7bff)) * don't map item row having `0` qty ([7611a49](7611a49)) * E-commerce issue with Item Variants ([53c3fff](53c3fff)) * german translations ([#34312](#34312)) ([dd0c833](dd0c833)) * hide `+` button based on `Blanket Order Type` ([daa1bb8](daa1bb8)) * incorrect depr schedules after asset repair [v14] ([#34527](#34527)) ([560df63](560df63)), closes [#30838](#30838) * Multiple accounting dimension filtering in AR/AP reports ([#34464](#34464)) ([f146479](f146479)) * Overallocation of 'qty' from Cr Notes to Parent Invoice ([848e56b](848e56b)) * patch depends on Currency Exchange Settings ([#34494](#34494)) ([4acde44](4acde44)) * POS not picking up pos profile company address instead fetch any random company address ([#34521](#34521)) ([01f4cc7](01f4cc7)) * Update account number from parent company ([#34474](#34474)) ([55d002c](55d002c)) * use max function to get default company address (backport [#34116](#34116)) ([#34452](#34452)) ([ba2fd71](ba2fd71)) ### Features * add field `Over Order Allowance (%)` in `Buying Settings` ([da915f1](da915f1)) * add field `Over Order Allowance (%)` in `Selling Settings` ([46b5ba9](46b5ba9)) * bank reconciliation and plaid changes ([#33986](#33986)) ([9b608ea](9b608ea)) * consider `over_order_allowance` while validating order qty ([932639b](932639b)) * consider `over_order_allowance` while validating sales order qty ([09b577a](09b577a)) * Support for Alternative Items in Quotation ([#33874](#33874)) ([9f7da21](9f7da21)) ### Performance Improvements * index against_sales_invoice field on DN items (backport [#34509](#34509)) ([#34510](#34510)) ([baa789b](baa789b))
# [14.19.0](frappe/erpnext@v14.18.3...v14.19.0) (2023-03-21) ### Bug Fixes * **client:** Amount calculation for 0 qty debit notes ([#34455](frappe/erpnext#34455)) ([d24f4d2](frappe/erpnext@d24f4d2)) * difference amount calculation for company currency accounts ([9ab7bff](frappe/erpnext@9ab7bff)) * don't map item row having `0` qty ([7611a49](frappe/erpnext@7611a49)) * E-commerce issue with Item Variants ([53c3fff](frappe/erpnext@53c3fff)) * german translations ([#34312](frappe/erpnext#34312)) ([dd0c833](frappe/erpnext@dd0c833)) * hide `+` button based on `Blanket Order Type` ([daa1bb8](frappe/erpnext@daa1bb8)) * incorrect depr schedules after asset repair [v14] ([#34527](frappe/erpnext#34527)) ([560df63](frappe/erpnext@560df63)), closes [#30838](frappe/erpnext#30838) * Multiple accounting dimension filtering in AR/AP reports ([#34464](frappe/erpnext#34464)) ([f146479](frappe/erpnext@f146479)) * Overallocation of 'qty' from Cr Notes to Parent Invoice ([848e56b](frappe/erpnext@848e56b)) * patch depends on Currency Exchange Settings ([#34494](frappe/erpnext#34494)) ([4acde44](frappe/erpnext@4acde44)) * POS not picking up pos profile company address instead fetch any random company address ([#34521](frappe/erpnext#34521)) ([01f4cc7](frappe/erpnext@01f4cc7)) * Update account number from parent company ([#34474](frappe/erpnext#34474)) ([55d002c](frappe/erpnext@55d002c)) * use max function to get default company address (backport [#34116](frappe/erpnext#34116)) ([#34452](frappe/erpnext#34452)) ([ba2fd71](frappe/erpnext@ba2fd71)) ### Features * add field `Over Order Allowance (%)` in `Buying Settings` ([da915f1](frappe/erpnext@da915f1)) * add field `Over Order Allowance (%)` in `Selling Settings` ([46b5ba9](frappe/erpnext@46b5ba9)) * bank reconciliation and plaid changes ([#33986](frappe/erpnext#33986)) ([9b608ea](frappe/erpnext@9b608ea)) * consider `over_order_allowance` while validating order qty ([932639b](frappe/erpnext@932639b)) * consider `over_order_allowance` while validating sales order qty ([09b577a](frappe/erpnext@09b577a)) * Support for Alternative Items in Quotation ([#33874](frappe/erpnext#33874)) ([9f7da21](frappe/erpnext@9f7da21)) ### Performance Improvements * index against_sales_invoice field on DN items (backport [#34509](frappe/erpnext#34509)) ([#34510](frappe/erpnext#34510)) ([baa789b](frappe/erpnext@baa789b))
Non-Primary company address is being auto fetched in sales invoice instead of primary company address. This Pull Request fixes that.
Before:
before.mp4
After:
after.mp4