-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[ADD] rental_deposit: implement deposit amount feature for rental products #898
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
base: 18.0
Are you sure you want to change the base?
Conversation
…ducts -Introduced configuration option to select a deposit product for rental orders -Added Require Deposit checkbox and amount field on rental product form -Automatically add deposit line with specified amount when adding rental product to orders -Display deposit price on website product page, updating with quantity changes -Show deposit amount with currency in order overview and checkout
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.
Commit msg title is too long and task id is also missing.
def _onchange_requires_deposit(self): | ||
if self.require_deposit: | ||
param_obj = self.env['ir.config_parameter'].sudo() | ||
deposit_product_id = param_obj.get_param('rental_deposit.deposit_product_id') |
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.
Your res_config_settings
uses config_parameter='rental_deposit.product_id'
but here you read param_obj.get_param('rental_deposit.deposit_product_id')
. Shouldn't this key match? Am I missing anything?
is_deposit_line = fields.Boolean( | ||
string="Is Deposit Line", | ||
help="Indicates whether this line is for a rental deposit", | ||
default=False | ||
) | ||
|
||
@api.depends('product_id') | ||
def _compute_is_deposit_line(self): | ||
for line in self: | ||
line.is_deposit_line = line.product_id and line.product_id.is_deposit_product |
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.
You define _compute_is_deposit_line
but never decorate it or assign it to is_deposit_line
either remove it or hook it properly.
for line in self: | ||
line.is_deposit_line = line.product_id and line.product_id.is_deposit_product | ||
|
||
def _compute_deposit_amount(self): |
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.
depends on?
-Introduced configuration option to select a deposit product for rental orders -Added Require Deposit checkbox and amount field on rental product form -Automatically add deposit line with specified amount when adding
rental product to orders
-Display deposit price on website product page, updating with quantity changes -Show deposit amount with currency in order overview and checkout