[TEST] add test for issue 1182111
authorAlexandre Fayolle <alexandre.fayolle@camptocamp.com>
Tue, 21 May 2013 14:44:18 +0000 (16:44 +0200)
committerAlexandre Fayolle <alexandre.fayolle@camptocamp.com>
Tue, 21 May 2013 14:44:18 +0000 (16:44 +0200)
bzr revid: alexandre.fayolle@camptocamp.com-20130521144418-x8pqpk632g3ew87j

addons/stock/__openerp__.py
addons/stock/stock_demo.xml
addons/stock/test/multicompany.yml [new file with mode: 0644]

index b3d7e30..db7117c 100644 (file)
@@ -94,6 +94,7 @@ Dashboard / Reports for Warehouse Management will include:
 #        'test/opening_stock.yml',
 #        'test/shipment.yml',
 #        'test/stock_report.yml',
+        'test/multicompany.yml'
     ],
     'installable': True,
     'application': True,
index eb5a6c4..d770ecc 100644 (file)
              <field name="company_id" ref="base.main_company"/>
         </record>
 
+        <record id="multicompany_user" model="res.users">
+          <field name="name">multicomp</field>
+          <field name="login">multicomp</field>
+          <field name="password">multicomp</field>
+          <field name="company_id" ref="res_partner_company_2"/>
+          <field name="company_ids" eval="[(6,0,[ref('res_partner_company_2')])]"/>
+          <field name="groups_id" eval="[(6,0,[ref('base.group_user'), ref('stock.group_stock_manager')])]"/>
+
+        </record>
+
     </data>
 </openerp>
 
diff --git a/addons/stock/test/multicompany.yml b/addons/stock/test/multicompany.yml
new file mode 100644 (file)
index 0000000..66e88d9
--- /dev/null
@@ -0,0 +1,14 @@
+
+-
+  Set the current user as multicompany user
+-
+  !context
+    'uid': 'stock.multicompany_user'
+-
+  check no error on getting default stock.move values for internal move
+-
+  !python {model: stock.move}:
+    context['picking_type'] = 'internal'
+    defaults = self.default_get(cr, uid, ['location_id', 'location_dest_id', 'type'], context)
+    assert defaults == {'location_id': False, 'location_dest_id': False, 'type': 'internal'}
+