Skip to content

Commit

Permalink
[FIX] sale_management: (revert) handle temp recs
Browse files Browse the repository at this point in the history
This PR reverts the commit
c6842f1

opw-3754297

closes #161868

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
  • Loading branch information
ethanrobv committed Apr 18, 2024
1 parent 9dac77e commit cbb1884
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit cbb1884

Please sign in to comment.