diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml index 10ae6a16d59..e51f20c67c9 100644 --- a/addons/stock/security/stock_security.xml +++ b/addons/stock/security/stock_security.xml @@ -10,7 +10,7 @@ Manager - + diff --git a/addons/stock/test/opening_stock.yml b/addons/stock/test/opening_stock.yml index 41b906e560c..9efcfd3af99 100644 --- a/addons/stock/test/opening_stock.yml +++ b/addons/stock/test/opening_stock.yml @@ -1,3 +1,8 @@ +- + Only stock manager can change the price and update stock of products, so let's check data with giving the access rights of manager +- + !context + uid: 'res_users_stock_manager' - I update the price of the 15” LCD Monitor. - @@ -32,6 +37,11 @@ !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 10, "Stock is not updated." +- + Stock user can merge inventory, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_stock_user' - I merge inventory. - @@ -42,11 +52,21 @@ - !python {model: stock.inventory.merge }: | self.do_merge(cr, uid, [ref('merge_inventory')], context=context) +- + Only stock manager cancelled inventory, so let's check data with giving the access rights of manager +- + !context + uid: 'res_users_stock_manager' - I cancel inventory. - !python {model: stock.inventory}: | self.action_cancel_inventory(cr, uid, [ref('stock_inventory_0')]) +- + stock user can reset inventory, so let's check data with giving the access rights of user +- + !context + uid: 'res_users_stock_user' - I reset to draft inventory. - @@ -108,11 +128,21 @@ !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.virtual_available == 100, "Vitual stock is not updated." +- + Only stock manager can close physical inventory, so let's check data with giving the access rights of manager +- + !context + uid: 'res_users_stock_manager' - I close physical inventory of 15” LCD Monitor. - !python {model: stock.inventory}: | self.action_done(cr, uid, [ref('stock_inventory_0')], context=context) +- + Stock user can check closed move and real stock, so let's check data with giving the access rights of user +- + !context + uid: 'res_users_stock_user' - I check closed move and real stock of 15” LCD Monitor after closed physical inventory. - diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml index b16ade8a085..f1a31f23d93 100644 --- a/addons/stock/test/stock_report.yml +++ b/addons/stock/test/stock_report.yml @@ -1,3 +1,8 @@ +- + Stock user can print all reports related to stock, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_stock_user' - I print a stock overview report of location. -