34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
-
|
|
Only sales manager Creates product so let's check with access rights of salemanager.
|
|
-
|
|
!context
|
|
uid: 'res_sale_stock_salesmanager'
|
|
-
|
|
In order to test the onchange of the Sale Order, I create a product
|
|
-
|
|
!record {model: product.product, id: product_onchange1}:
|
|
name: 'Devil Worship Book'
|
|
list_price: 66.6
|
|
procure_method: 'make_to_order'
|
|
default_code: 'DWB00001'
|
|
-
|
|
In sale order to test process of onchange of Sale Order with access rights of saleman.
|
|
-
|
|
!context
|
|
uid: 'res_sale_stock_salesman'
|
|
-
|
|
Now i create a sale order that uses my new product
|
|
-
|
|
!record {model: sale.order, id: sale_order_onchange1}:
|
|
partner_id: base.res_partner_2
|
|
order_line:
|
|
- product_id: sale_stock.product_onchange1
|
|
product_uom_qty: 10
|
|
-
|
|
I verify that the onchange of product on sale order line was correctly triggered
|
|
-
|
|
!assert {model: sale.order, id: sale_order_onchange1, string: The onchange function of product was not correctly triggered}:
|
|
- order_line[0].name == u'[DWB00001] Devil Worship Book'
|
|
- order_line[0].price_unit == 66.6
|
|
- order_line[0].type == 'make_to_order'
|