← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~camptocamp/ocb-addons/ocb-7.0-fix_broken_purchase_requisition_tests_1278078-afe into lp:ocb-addons

 

Alexandre Fayolle - camptocamp has proposed merging lp:~camptocamp/ocb-addons/ocb-7.0-fix_broken_purchase_requisition_tests_1278078-afe into lp:ocb-addons.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1278078 in OpenERP Community Backports (Addons): "Broken yml test for purchase requisition"
  https://bugs.launchpad.net/ocb-addons/+bug/1278078

For more details, see:
https://code.launchpad.net/~camptocamp/ocb-addons/ocb-7.0-fix_broken_purchase_requisition_tests_1278078-afe/+merge/209925

fix the broken purchase_requisition test in ocb-addons
-- 
https://code.launchpad.net/~camptocamp/ocb-addons/ocb-7.0-fix_broken_purchase_requisition_tests_1278078-afe/+merge/209925
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~camptocamp/ocb-addons/ocb-7.0-fix_broken_purchase_requisition_tests_1278078-afe into lp:ocb-addons.
=== modified file 'purchase_requisition/test/cancel_purchase_requisition.yml'
--- purchase_requisition/test/cancel_purchase_requisition.yml	2011-12-02 05:15:06 +0000
+++ purchase_requisition/test/cancel_purchase_requisition.yml	2014-03-07 13:39:56 +0000
@@ -2,25 +2,25 @@
   I cancel requisition.
 -
   !python {model: purchase.requisition}: |
-    self.tender_cancel(cr, uid, [ref("requisition1")])
+    self.tender_cancel(cr, uid, [ref("requisition2")])
 -
   I check requisition after cancelled.
 -
-  !assert {model: purchase.requisition, id: requisition1}:
+  !assert {model: purchase.requisition, id: requisition2}:
     - state == 'cancel'
 -
   I reset requisition as "New".
 -
   !python {model: purchase.requisition}: |
-    self.tender_reset(cr, uid, [ref('requisition1')])
+    self.tender_reset(cr, uid, [ref('requisition2')])
 -
   I duplicate requisition.
 -
   !python {model: purchase.requisition}: |
-    self.copy(cr, uid, ref('requisition1'))
+    self.copy(cr, uid, ref('requisition2'))
 -
   I delete requisition.
 -
-  !python {model: purchase.order}: |
-    self.unlink(cr, uid, [ref("requisition1")])
+  !python {model: purchase.requisition}: |
+    self.unlink(cr, uid, [ref("requisition2")])
 

=== modified file 'purchase_requisition/test/purchase_requisition.yml'
--- purchase_requisition/test/purchase_requisition.yml	2012-10-23 16:05:04 +0000
+++ purchase_requisition/test/purchase_requisition.yml	2014-03-07 13:39:56 +0000
@@ -88,3 +88,14 @@
     (data, format) = netsvc.LocalService('report.purchase.requisition').create(cr, uid, [ref('purchase_requisition.requisition1')], {}, {})
     if tools.config['test_report_directory']:
         file(os.path.join(tools.config['test_report_directory'], 'purchase_requisition-purchase_requisition_report.'+format), 'wb+').write(data)
+-
+  I check that I cannot cancel the requisision
+-
+  !python {model: purchase.requisition}: |
+    from openerp.osv.osv import except_osv
+    try:
+        self.tender_cancel(cr, uid, [ref("requisition1")])
+    except except_osv, exc:
+        assert exc.args == (u'Unable to cancel this purchase order.', u'First cancel all receptions related to this purchase order.')
+    else:
+        assert False, 'tender_cancel should have failed'

=== modified file 'purchase_requisition/test/purchase_requisition_demo.yml'
--- purchase_requisition/test/purchase_requisition_demo.yml	2012-10-23 16:05:04 +0000
+++ purchase_requisition/test/purchase_requisition_demo.yml	2014-03-07 13:39:56 +0000
@@ -7,4 +7,10 @@
       - product_id: product.product_product_9
         product_qty: 10.0
         product_uom_id: product.product_uom_unit
-  
+-
+  !record {model: purchase.requisition, id: requisition2}:
+    exclusive: exclusive
+    line_ids:
+      - product_id: product.product_product_13
+        product_qty: 10.0
+        product_uom_id: product.product_uom_unit


Follow ups