[FIX]account_followup : fix bug in test where year was hardcoded and it is not the...
[odoo/odoo.git] / addons / account_followup / test / account_followup.yml
index d799697..ceb7ec2 100644 (file)
@@ -1,35 +1,25 @@
 -
-  In order to test account followup module in OpenERP, I change the state of invoice to "open".
--
+  In order to test account follow-up module in OpenERP, I change the state of invoice to "open".
+-
+  !record {model: account.invoice, id: account.demo_invoice_0}:
+    check_total: 14.0
+    date_invoice: !eval "'%s-06-2' %(datetime.now().year)"
+    invoice_line:
+      - account_id : account.a_sale
+        name: 'Test PC'
+        quantity: 1.0
+    journal_id: account.bank_journal
+    partner_id: base.res_partner_12
+    reference_type: none    
+-   
   !workflow {model: account.invoice, action: invoice_open, ref: account.demo_invoice_0}
 -
-  !record {model: account.followup.print, id: account_followup_print_0}:
-    {}
--
-  I select the followup to send it to the partner.
--
-  !python {model: account.followup.print}: |
-    self.do_continue(cr, uid, [ref("account_followup_print_0")], {"lang": 'en_US',
-      "active_model": "ir.ui.menu", "active_ids": [ref("account_followup.account_followup_print_menu")],
-      "tz": False, "active_id": ref("account_followup.account_followup_print_menu"),
-      })
+  I create a follow-up.
 -
-  I select partners whom I want to send followups.
--
-  !record {model: account.followup.print.all, id: account_followup_print_all_0}:
-    email_body: 'Date : %(date)s\n\nDear %(partner_name)s,\n\nPlease find in attachment
-      a reminder of all your unpaid invoices, for a total amount due of:\n\n%(followup_amount).2f
-      %(company_currency)s\n\nThanks,\n--\n%(user_signature)s\n%(company_name)s'
-    email_subject: Invoices Reminder
-    partner_ids:
-      - base.res_partner_desertic_hispafuentes
-    partner_lang: 1
--
-  I send a followup mail to partner.
--
-  !python {model: account.followup.print.all}: |
-    import time
-    self.do_mail(cr, uid, [ref("account_followup_print_all_0")], {"lang": 'en_US',
-      "active_model": "ir.ui.menu", "active_ids": [ref("account_followup.account_followup_print_menu")],
-      "tz": False, "date": time.strftime('%Y-%m-%d'), "followup_id": ref("account_followup.demo_followup1"), "active_id": ref("account_followup.account_followup_print_menu"),
-      })
+  !record {model: account_followup.print, id: account_followup_print_0}:
+    {}
+- 
+  I will process follow-ups
+- 
+  !python {model: account_followup.print}:  |
+    self.do_process(cr, uid, [ref("account_followup_print_0")], {"active_ids": [ref("account_followup.account_followup_print_menu")], "active_id": ref("account_followup.account_followup_print_menu"),})
\ No newline at end of file