Conversation
When the rental modules are installed on a database with existing sale orders, several fields remain NULL because defaults and computes only apply to new records. This causes errors when editing old quotations (the Order Type radio buttons appear blank, attrs evaluation fails). The post_init_hook sets the correct default values on existing records: - sale_order.type_id = normal_sale_type (xmlid via ORM, update via SQL) - sale_order_line.rental = False - sale_order_line.can_sell_rental = False
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 16.0 #885 +/- ##
==========================================
+ Coverage 44.30% 44.41% +0.11%
==========================================
Files 313 314 +1
Lines 6230 6243 +13
Branches 989 989
==========================================
+ Hits 2760 2773 +13
Misses 3449 3449
Partials 21 21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
type_id,rentalandcan_sell_rentalfields remain NULL because defaults/computes only apply to new recordspost_init_hookthat sets the correct defaults on existing records via SQL (xmlid resolved via ORM)Test plan
rental_base_extensionon a database with existing sale orderstype_idset to "Normal Order"rental = Falseandcan_sell_rental = False