2013-03-14 13:37:50 +00:00
|
|
|
-
|
2013-03-15 05:27:29 +00:00
|
|
|
Only sales manager Creates product so let's check with access rights of salemanager.
|
2013-03-14 13:37:50 +00:00
|
|
|
-
|
|
|
|
!context
|
|
|
|
uid: 'res_sale_stock_salesmanager'
|
2012-09-28 10:15:31 +00:00
|
|
|
-
|
|
|
|
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
|
2015-06-22 17:14:35 +00:00
|
|
|
default_code: 'DWB00001'
|
2013-03-15 05:27:29 +00:00
|
|
|
-
|
|
|
|
In sale order to test process of onchange of Sale Order with access rights of saleman.
|
|
|
|
-
|
|
|
|
!context
|
|
|
|
uid: 'res_sale_stock_salesman'
|
2012-09-28 10:15:31 +00:00
|
|
|
-
|
|
|
|
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
|
2012-10-01 16:08:54 +00:00
|
|
|
order_line:
|
|
|
|
- product_id: sale_stock.product_onchange1
|
|
|
|
product_uom_qty: 10
|
2012-09-28 10:15:31 +00:00
|
|
|
-
|
|
|
|
I verify that the onchange of product on sale order line was correctly triggered
|
|
|
|
-
|
2012-10-01 16:19:54 +00:00
|
|
|
!assert {model: sale.order, id: sale_order_onchange1, string: The onchange function of product was not correctly triggered}:
|
2015-06-22 17:14:35 +00:00
|
|
|
- order_line[0].name == u'[DWB00001] Devil Worship Book'
|
2012-10-01 16:08:54 +00:00
|
|
|
- order_line[0].price_unit == 66.6
|