[FIX] website_sale{,_stock}: fix issue with tests

Multiple tests introduced in 16.0 created a product template and then a
default product for that template, however a default product is already
created by default in the product module when creating a template and it
somecases triggered an unicity constraint.

closes odoo/odoo#108523

X-original-commit: 3c9ff6e148cd0ee77442dd31079f0fec9c456b4c
Related: odoo/enterprise#35180
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit is contained in:
William Braeckman
2022-12-22 13:47:58 +01:00
parent f9ec85614b
commit ae497d22e5
2 changed files with 2 additions and 9 deletions
@@ -198,11 +198,7 @@ class TestWebsiteSaleCartAbandoned(TestWebsiteSaleCartAbandonedCommon):
'list_price': 0.0,
'name': 'free_product'
})
free_product_product = self.env['product.product'].create({
'list_price': 0.0,
'name': 'free_product',
'product_tmpl_id': free_product_template.id
})
free_product_product = free_product_template.product_variant_id
order_line = [[0, 0, {
'name': 'The Product',
'product_id': free_product_product.id,
@@ -20,10 +20,7 @@ class TestWebsiteSaleStockAbandonedCartEmail(TestWebsiteSaleCartAbandonedCommon)
'type': 'product',
'allow_out_of_stock_order': False
})
storable_product_product = self.env['product.product'].create({
'name': 'storable_product_product',
'product_tmpl_id': storable_product_template.id,
})
storable_product_product = storable_product_template.product_variant_id
order_line = [[0, 0, {
'name': 'The Product',
'product_id': storable_product_product.id,