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

[FIX] sale_management: (revert) handle temp recs #161868

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 @@ -89,8 +89,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
# Drop the temporary record from the cache
new_sol.invalidate_recordset(flush=False)
# Avoid attaching the new line when called on template change
new_sol.order_id = False

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

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