[FIX] sale_management: (revert) handle temp recs

This PR reverts the commit
https://github.com/odoo/odoo/commit/c6842f1

opw-3754297

closes odoo/odoo#161868

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Ethan Vincent
2024-04-18 15:05:21 +00:00
parent 9dac77e414
commit cbb18848f6
@@ -89,8 +89,8 @@ class SaleOrderOption(models.Model):
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):
@@ -102,8 +102,8 @@ class SaleOrderOption(models.Model):
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()