[ADD] rental_deposit: introduce deposit mechanism for rental products#1322
Draft
vikvi-odoo wants to merge 1 commit into
Draft
[ADD] rental_deposit: introduce deposit mechanism for rental products#1322vikvi-odoo wants to merge 1 commit into
vikvi-odoo wants to merge 1 commit into
Conversation
- Added deposit_product_id Many2one configuration field to res.config.settings under the sale_renting scope. - Introduced is_deposit boolean flag and deposit_amount monetary field attributes to the product template model. - Implemented backend business logic to automatically append corresponding deposit lines onto sale/rental order forms. - Configured automated compute triggers to synchronize line deposit totals dynamically with shifts in item quantities. - Extended website storefront by injecting a real-time deposit information section right below the core add-to-cart layout box. - Baked Python database fields safely into HTML5 dataset parameters. - Standardized shopping cart rows by changing the display header to 'Deposit for [Product Name]' using strict method selectors. - Added deposit_product_id Many2one configuration field to res.config.settings under the sale_renting scope. - Introduced is_deposit boolean flag and deposit_amount monetary field attributes to the product template model. - Implemented backend business logic to automatically append corresponding deposit lines onto sale/rental order forms. - Configured automated compute triggers to synchronize line deposit totals dynamically with shifts in item quantities. - Extended website storefront by injecting a real-time deposit information section right below the core add-to-cart layout box. - Developed a native frontend public widget to handle quantity value updates and instantly update calculated values in the browser. - Baked Python database fields safely into HTML5 dataset parameters to avoid string parsing or currency sign conflicts in JavaScript. - Standardized shopping cart rows by changing the display header to 'Deposit for [Product Name]' using strict method selectors. - Suppressed manual desktop and mobile item removal actions for deposit rows while keeping default behaviors intact for regular items.
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.

Problem
Rental workflows currently lack a proper way to manage security deposits, which are a common requirement for renting high-value or damage-sensitive products. In the absence of a standard mechanism, users rely on manual workarounds such as adding extra order lines or handling deposits outside the system. This leads to inconsistent processes, higher risk of errors, and no clear link between the rented product and its associated deposit. It also impacts the website experience, as customers have no visibility of required deposits before placing an order.
Solution
This PR introduces a structured and configurable deposit mechanism to handle this scenario in a consistent and automated way across both backend and frontend flows.
Key Changes
Global Configuration: Added a global deposit product configuration in settings.
Product Controls: Allow defining deposit requirement and per-unit amount on products.
Automated Orders: Automatically create and manage deposit lines on sale/rental orders.
Quantity Sync: Ensure deposit amounts stay in sync with product quantities.
Website Extension: Extend the behavior to the website, displaying deposit details to customers.
Result
Deposits are always applied when required.
No manual adjustments needed.
Clear traceability between rental items and deposits.
Improved user and customer experience.