From 1adc0b785a2e1d6020ecc084eb443096eddf58a9 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 4 Apr 2014 14:45:18 +0200 Subject: [PATCH] [IMP] bring back the tests for mrp_operations - backported from little after v7.0 in the trunk lp bug: https://launchpad.net/bugs/1182515 fixed bzr revid: ls@numerigraphe.com-20140404124518-jv77xw4z0ouoaqlz --- addons/mrp_operations/__openerp__.py | 2 +- .../test/workcenter_operations.yml | 24 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/addons/mrp_operations/__openerp__.py b/addons/mrp_operations/__openerp__.py index 7fedb426edd..12d86e0b532 100644 --- a/addons/mrp_operations/__openerp__.py +++ b/addons/mrp_operations/__openerp__.py @@ -70,7 +70,7 @@ So, that we can compare the theoretic delay and real delay. 'mrp_operations_demo.yml' ], 'test': [ -# 'test/workcenter_operations.yml', + 'test/workcenter_operations.yml', ], 'installable': True, 'auto_install': False, diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index c1449657967..f402e1cddd4 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -1,6 +1,24 @@ +- + Create a user as 'MRP User' +- + !record {model: res.users, id: res_mrp_operation_user}: + company_id: base.main_company + name: MRP User + login: maou + password: maou + email: mrp_operation_user@yourcompany.com +- + I added groups for MRP User. +- + !record {model: res.users, id: res_mrp_operation_user}: + groups_id: + - mrp.group_mrp_user - In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC349 - with routing - Manual Component's Assembly to test complete production process with respect of workcenter. + with routing - Manual Component's Assembly to test complete production process with respect of workcenter with giving access rights of MRP User. +- + !context + uid: 'res_mrp_operation_user' - I compute the production order. - @@ -106,7 +124,7 @@ I print a Barcode Report of Operation line. - !python {model: mrp_operations.operation.code}: | - import netsvc, tools, os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.mrp.code.barcode').create(cr, uid, [ref('mrp_operations.mrp_op_1'),ref('mrp_operations.mrp_op_2'),ref('mrp_operations.mrp_op_3'),ref('mrp_operations.mrp_op_4'),ref('mrp_operations.mrp_op_5')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcode_report.'+format), 'wb+').write(data) @@ -115,7 +133,7 @@ I print Workcenter's Barcode Report. - !python {model: mrp.workcenter}: | - import netsvc, tools, os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.mrp.wc.barcode').create(cr, uid, [ref('mrp.mrp_workcenter_0'),ref('mrp.mrp_workcenter_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-workcenter_barcode_report.'+format), 'wb+').write(data)