From 0418aee3c7b8fd1cc73f42846cfd91040dd136d6 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Wed, 22 May 2013 17:37:05 +0200 Subject: [PATCH] [TEST] new tests for lp:118211 on mrp bzr revid: alexandre.fayolle@camptocamp.com-20130522153705-vivt0a2wb4xwesco --- addons/mrp/__openerp__.py | 1 + addons/mrp/test/multicompany.yml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 addons/mrp/test/multicompany.yml diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index 6e025ae2d90..2fde404bf12 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -77,6 +77,7 @@ Dashboard / Reports for MRP will include: #TODO: This yml tests are needed to be completely reviewed again because the product wood panel is removed in product demo as it does not suit for new demo context of computer and consultant company # so the ymls are too complex to change at this stage 'test': [ + 'test/multicompany.yml', # 'test/order_demo.yml', # 'test/order_process.yml', # 'test/cancel_order.yml', diff --git a/addons/mrp/test/multicompany.yml b/addons/mrp/test/multicompany.yml new file mode 100644 index 00000000000..06d927afc65 --- /dev/null +++ b/addons/mrp/test/multicompany.yml @@ -0,0 +1,16 @@ +- + Set the current user as multicompany user +- + !context + uid: 'stock.multicompany_user' + +- + check no error on getting default mrp.production values in multicompany setting +- + !python {model: mrp.production}: | + location_obj = self.pool.get('stock.location') + fields = ['location_src_id', 'location_dest_id'] + defaults = self.default_get(cr, uid, ['location_id', 'location_dest_id', 'type'], context) + for field in fields: + if defaults[field] != False: + assert location_obj.check_access_rule(cr, uid, defaults[field], 'read', context), "unreadable location %s" % field