-
Notifications
You must be signed in to change notification settings - Fork 1.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
[IMP] rental_deposit: added deposit in rental #422
base: 18.0
Are you sure you want to change the base?
Conversation
added deposit product in config settings by inheriting res_config_settings model added require deposit and deposit amount in product template by inhering product_template model added inherited view for template as well as config settings also inherited view for product template task - 4605761
- Deposit will be added in sale order line when any product is selected in which deposit is configured - Also added write override, if product or quantity is changed then it reflects to deposit also - Added unlink override if product which has deposit and removed it from sale order line then remove deposit also - In website module on rental product, required deposit will be displayed task - 4605761
- Ensured that only one deposit added when duplicating sale order - Controller added to track qty from website. - improved sale order line creation logic task - 4605761
- Ensured that on duplicating more than one sale order ensure that it works perfectly - Onchange method is defined in product_template task - 4605761
@api.onchange('require_deposit') | ||
def _onchange_require_deposit(self): | ||
self.write({ | ||
'deposit_amount': 0 if self.require_deposit else 0 |
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.
why?
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.
This is not needed
I was checking that if someone after setting a deposit untick then retick on that time it should be zero.
But it i forgot to remove it
so i will remove it
vals_list = super().copy_data(default=default) | ||
for order, vals in zip(self, vals_list): | ||
vals['order_line'] = [ | ||
Command.create(line) |
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.
where have you define line
?
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.
below line 19, in for loop
Command.create(line)
for line in order._get_copiable_order_lines_without_deposit().copy_data()
- Removed onchange_require_deposit as not needed - Instead of direct creating deposit line used list to create it - Extended controller class to get qty in website - Extended Widget to display deposit which change based on required quantity
- sudo() removed as without bypassing access rights we can get deposit product
product_template model
deposit is configured
to deposit also
order line then remove deposit also
task - 4605761