[IMP] give access rights in yml of sale_stock

bzr revid: fka@tinyerp.com-20130314133750-r034ygbcna6l49m6
This commit is contained in:
Foram Katharotiya (OpenERP) 2013-03-14 19:07:50 +05:30
parent 541a46fb87
commit 5a3acd71ed
6 changed files with 91 additions and 5 deletions

View File

@ -59,7 +59,8 @@ You can choose flexible invoicing methods:
],
'data': ['sale_stock_data.xml'],
'demo_xml': ['sale_stock_demo.xml'],
'test': ['test/cancel_order_sale_stock.yml',
'test': ['test/sale_stock_users.yml',
'test/cancel_order_sale_stock.yml',
'test/picking_order_policy.yml',
'test/prepaid_order_policy.yml',
'test/sale_order_onchange.yml',

View File

@ -1,6 +1,9 @@
-
In order to test the cancel sale order.
In order to test the cancel sale order with that user which have salesman rights.
First I confirm order.
-
!context
uid: 'res_sale_stock_salesman'
-
!workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_8}
-
@ -8,7 +11,7 @@
-
!python {model: stock.picking}: |
delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
first_picking = self.browse(cr, uid, delivery_orders[0], context=context)
first_picking = self.browse(cr, uid, delivery_orders[0], context=None)
if first_picking.force_assign(cr, uid, first_picking):
first_move = first_picking.move_lines[0]
values = {'move%s'%(first_move.id): {'product_qty': 2, 'product_uom':ref('product.product_uom_unit')}}
@ -20,12 +23,22 @@
delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
last_delivery_order_id = delivery_orders[0]
self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id])
-
Only Stock User can change data related warehouse therfore test with that user which have stcok user rights,
-
!context
uid: 'res_stock_user'
-
I run the scheduler.
-
!python {model: procurement.order}: |
self.run_scheduler(cr, uid)
-
Salesman can also check order therfore test with that user which have salesman rights,
-
!context
uid: 'res_sale_stock_salesman'
-
I check order status in "Ship Exception".
-

View File

@ -1,5 +1,8 @@
-
In order to test process of the Sale Order,
In order to test process of the Sale Order with access rights of saleman,
-
!context
uid: 'res_sale_stock_salesman'
-
First I check the total amount of the Quotation before Approved.
-
@ -33,11 +36,21 @@
assert procurement.product_qty == order_line.product_uom_qty, "Qty is not correspond."
assert procurement.product_uom.id == order_line.product_uom.id, "UOM is not correspond."
assert procurement.procure_method == order_line.type, "Procurement method is not correspond."
-
Only Stock User can change data related warehouse therfore test with that user which have stcok user rights,
-
!context
uid: 'res_stock_user'
-
I run the scheduler.
-
!python {model: procurement.order}: |
self.run_scheduler(cr, uid)
-
Salesman can also check order therfore test with that user which have salesman rights,
-
!context
uid: 'res_sale_stock_salesman'
-
I check the details of delivery order after confirmed quotation.
-
@ -128,6 +141,11 @@
assert inv_line.price_unit == so_line.price_unit , "Price Unit is not correspond."
assert inv_line.quantity == (so_line.product_uos and so_line.product_uos_qty) or so_line.product_uom_qty , "Product qty is not correspond."
assert inv_line.price_subtotal == so_line.price_subtotal, "Price sub total is not correspond."
-
Only Stock manager can open the Invoice therfore test with that user which have stock manager rights,
-
!context
uid: 'res_stock_manager'
-
I open the Invoice.
-
@ -149,6 +167,11 @@
journal_ids[0], ref('account.cash'),
ref('account.period_8'), journal_ids[0],
name='test')
-
To test process of the Sale Order with access rights of saleman,
-
!context
uid: 'res_sale_stock_salesman'
-
I check the order after paid invoice.
-

View File

@ -1,5 +1,8 @@
-
Now I confirm the Quotation with "Pay before delivery" policy.
Now I confirm the Quotation with "Pay before delivery" policy with access rights of salesman.
-
!context
uid: 'res_sale_stock_salesman'
-
!workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_4}
-

View File

@ -1,3 +1,8 @@
-
In sale order to test process of onchange of Sale Order 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
-

View File

@ -0,0 +1,41 @@
-
Create a user as 'Salesmanager'
-
!record {model: res.users, id: res_sale_stock_salesmanager}:
company_id: base.main_company
name: Sales manager
login: ssm
password: ssm
groups_id:
- base.group_sale_manager
-
Create a user as 'Salesman'
-
!record {model: res.users, id: res_sale_stock_salesman}:
company_id: base.main_company
name: Salesman
login: ssu
password: ssu
groups_id:
- base.group_sale_salesman_all_leads
-
Create a user as 'Stock User'
-
!record {model: res.users, id: res_stock_user}:
company_id: base.main_company
name: Stock User
login: sau
password: sau
groups_id:
- stock.group_stock_user
-
Create a user as 'Stock Manager'
-
!record {model: res.users, id: res_stock_manager}:
company_id: base.main_company
name: Stock Manager
login: sam
password: sam
email: admin@portal.example.com
groups_id:
- stock.group_stock_manager