1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
-
In order to test the de-activation of a product,
we will create a product and try to de-activate it
-
Create the product P7
-
!record {model: product.product, id: product7}:
categ_id: product_cat1
name: P7
supply_method: buy
type: product
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
-
Then, we a create a RfQ
-
!record {model: purchase.order, id: rfq2}:
date_order: !eval time.strftime('%Y-%m-%d')
minimum_planned_date: !eval time.strftime('%Y-%m-%d')
location_id: stock.stock_location_stock
partner_address_id: supplier_address_1
partner_id: supplier1
pricelist_id: purchase.list0
rfq_ok: True
order_line:
- company_id: base.main_company
date_planned: !eval time.strftime('%Y-%m-%d')
price_unit: 1.0
product_id: product7
product_qty: 1.0
product_uom: product.product_uom_unit
-
Send the RfQ
-
!python {model: purchase.order}: |
self.rfq_sent(cr, uid, [ref('rfq2')])
-
Then, we try to de-activate this product
-
!python {model: product.product}: |
res = self.deactivate_product(cr, uid, ref('product7'))
assert type(res) == type({}) and res.get('res_model') == 'product.deactivation.error', "No error occured when the de-activation of the product"
|