← Back to team overview

banking-addons-drivers team mailing list archive

[Merge] lp:~therp-nl/banking-addons/70-communication-communication2-clarify+tests into lp:~banking-addons-drivers/banking-addons/70-communication-communication2-clarify

 

Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/banking-addons/70-communication-communication2-clarify+tests into lp:~banking-addons-drivers/banking-addons/70-communication-communication2-clarify.

Requested reviews:
  Banking Addons Drivers (banking-addons-drivers)

For more details, see:
https://code.launchpad.net/~therp-nl/banking-addons/70-communication-communication2-clarify+tests/+merge/212611
-- 
https://code.launchpad.net/~therp-nl/banking-addons/70-communication-communication2-clarify+tests/+merge/212611
Your team Banking Addons Drivers is requested to review the proposed merge of lp:~therp-nl/banking-addons/70-communication-communication2-clarify+tests into lp:~banking-addons-drivers/banking-addons/70-communication-communication2-clarify.
=== modified file 'account_banking_tests/tests/test_payment_roundtrip.py'
--- account_banking_tests/tests/test_payment_roundtrip.py	2013-09-26 17:55:00 +0000
+++ account_banking_tests/tests/test_payment_roundtrip.py	2014-03-25 13:24:43 +0000
@@ -163,6 +163,8 @@
                         'price_unit': 100.0,
                         'quantity': 1,
                         'account_id': expense_id,})],
+            'reference_type': 'none',
+            'supplier_invoice_number': 'INV1',
             }
         self.invoice_ids = [
             invoice_model.create(
@@ -171,7 +173,11 @@
                     })]
         values.update({
                 'partner_id': supplier2,
-                'name': 'Purchase 2'})
+                'name': 'Purchase 2',
+                'reference_type': 'structured',
+                'supplier_invoice_number': 'INV2',
+                'reference': 'STR2',
+                })
         self.invoice_ids.append(
             invoice_model.create(
                 cr, uid, values, context={
@@ -247,6 +253,27 @@
                 }, context=context)
         reg('payment.order.create').create_payment(
             cr, uid, [self.payment_order_create_id], context=context)
+
+        # Check if payment lines are created with the correct reference
+        self.assertTrue(
+            reg('payment.line').search(
+                cr, uid, [
+                    ('move_line_id.invoice', '=', self.invoice_ids[0]),
+                    ('communication', '=', 'INV1'),
+                    ('state', '=', 'normal'),
+                    ], context=context),
+            'No payment line created from invoice 1 or with the wrong '
+            'communication')
+        self.assertTrue(
+            reg('payment.line').search(
+                cr, uid, [
+                    ('move_line_id.invoice', '=', self.invoice_ids[1]),
+                    ('communication', '=', 'STR2'),
+                    ('state', '=', 'structured'),
+                    ], context=context),
+            'No payment line created from invoice 2 or with the wrong '
+            'communication')
+
         wf_service = netsvc.LocalService('workflow')
         wf_service.trg_validate(
             uid, 'payment.order', self.payment_order_id, 'open', cr)