Skip to content
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

[FW][FIX] sale_management: dispense temp cache records #159661

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions addons/sale_management/models/sale_order_option.py
Expand Up @@ -88,8 +88,8 @@ def _compute_price_unit(self):
new_sol = self.env['sale.order.line'].new(values)
new_sol._compute_price_unit()
option.price_unit = new_sol.price_unit
# Avoid attaching the new line when called on template change
new_sol.order_id = False
# Drop the temporary record from the cache
new_sol.invalidate_recordset(flush=False)

@api.depends('product_id', 'uom_id', 'quantity')
def _compute_discount(self):
Expand All @@ -101,8 +101,8 @@ def _compute_discount(self):
new_sol = self.env['sale.order.line'].new(values)
new_sol._compute_discount()
option.discount = new_sol.discount
# Avoid attaching the new line when called on template change
new_sol.order_id = False
# Drop the temporary record from the cache
new_sol.invalidate_recordset(flush=False)

def _get_values_to_add_to_order(self):
self.ensure_one()
Expand Down