Exemple #1
0
 def test_orderpoint_2(self):
     """As a user of Company A, check it is not possible to change the company on an existing
     orderpoint to Company B.
     """
     product = self.env['product.product'].create({
         'type': 'product',
         'name': 'shared product',
     })
     orderpoint = Form(self.env['stock.warehouse.orderpoint'].with_user(
         self.user_a))
     orderpoint.company_id = self.company_a
     orderpoint.warehouse_id = self.warehouse_a
     orderpoint.location_id = self.stock_location_a
     orderpoint.product_id = product
     orderpoint = orderpoint.save()
     self.assertEqual(orderpoint.company_id, self.company_a)
     with self.assertRaises(UserError):
         orderpoint.company_id = self.company_b.id
Exemple #2
0
 def test_orderpoint_1(self):
     """As a user of company A, create an orderpoint for company B. Check itsn't possible to
     use a warehouse of companny A"""
     product = self.env['product.product'].create({
         'type': 'product',
         'name': 'shared product',
     })
     orderpoint = Form(self.env['stock.warehouse.orderpoint'].with_user(
         self.user_a))
     orderpoint.company_id = self.company_b
     orderpoint.warehouse_id = self.warehouse_b
     orderpoint.location_id = self.stock_location_a
     orderpoint.product_id = product
     with self.assertRaises(UserError):
         orderpoint.save()
     orderpoint.location_id = self.stock_location_b
     orderpoint = orderpoint.save()
     self.assertEqual(orderpoint.company_id, self.company_b)