[IMP]account_followup: Improvement in yml is Done for constraint
[odoo/odoo.git] / addons / account_followup / test / account_followup.yml
1 -
2   In order to test account followup module in OpenERP I create a FollowUp structure
3 -
4   !record {model: res.company, id: ymltest_company_2}:
5         name: Acme 2
6 -
7   !record {model: account_followup.followup, id: account_followup_followup_testfollowups0}:
8     description: First letter after 15 net days, 30 net days and 45 days end of month levels.
9     company_id: ymltest_company_2
10     followup_line:
11       - delay: 15
12         name: 'level 0: 15 days'
13         sequence: 0
14         start: days
15         description: Dear %(partner_name)s,\n\nException made if there was a mistake
16           of ours, it seems that the following amount staid unpaid. Please, take appropriate
17           measures in order to carry out this payment in the next 1 days.\n\nWould your
18           payment have been carried out after this mail was sent, please consider the
19           present one as void. Do not hesitate to contact our accounting department at
20           (+32).10.68.94.39.\n\nBest Regards,\n
21       - delay: 30
22         name: 'level1: 30 days'
23         sequence: 1
24         start: days
25         description: Dear %(partner_name)s,\n\nException made if there was a mistake
26           of ours, it seems that the following amount staid unpaid. Please, take appropriate
27           measures in order to carry out this payment in the next 2 days.\n\nWould your
28           payment have been carried out after this mail was sent, please consider the
29           present one as void. Do not hesitate to contact our accounting department at
30           (+32).10.68.94.39.\n\nBest Regards,\n
31       - delay: 45
32         name: 'level 2: 45 days'
33         sequence: 2
34         start: days
35         description: Dear %(partner_name)s,\n\nException made if there was a mistake
36           of ours, it seems that the following amount staid unpaid. Please, take appropriate
37           measures in order to carry out this payment in the next 3 days.\n\nWould your
38           payment have been carried out after this mail was sent, please consider the
39           present one as void. Do not hesitate to contact our accounting department at
40           (+32).10.68.94.39.\n\nBest Regards,
41     name: My followups
42
43 -
44   I create an invoice
45 -
46   !record {model: account.invoice, id: account_invoice_followup}:
47     account_id: account.a_recv
48     address_contact_id: base.res_partner_address_3000
49     address_invoice_id: base.res_partner_address_3000
50     company_id: base.main_company
51     currency_id: base.EUR
52     invoice_line:
53       - account_id: account.a_sale
54         name: '[PC1] Basic PC'
55         price_unit: 450.0
56         quantity: 1.0
57         product_id: product.product_product_pc1
58         uos_id: product.product_uom_unit
59     journal_id: account.sales_journal
60     partner_id: base.res_partner_desertic_hispafuentes
61     reference_type: none
62
63
64 -
65   I change the state of the invoice using create button
66 -
67   !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_followup}
68
69 -
70   I create a send followup record
71 -
72   !record {model: account.followup.print, id: account_followup_print_0}:
73     date: !eval time.strftime('%Y-%m-%d')
74     followup_id: account_followup_followup_testfollowups0
75
76
77 -
78   I Select Followup and clicked on Continue Button
79 -
80   !python {model: account.followup.print}: |
81     self.do_continue(cr, uid, [ref("account_followup_print_0")], {"lang": 'en_US',
82       "active_model": "ir.ui.menu", "active_ids": [ref("account_followup.account_followup_print_menu")],
83       "tz": False, "active_id": ref("account_followup.account_followup_print_menu"),
84       })
85
86
87 -
88   I select partners whom I want to send followups
89 -
90   !record {model: account.followup.print.all, id: account_followup_print_all_0}:
91     email_body: 'Date : %(date)s\n\nDear %(partner_name)s,\n\nPlease find in attachment
92       a reminder of all your unpaid invoices, for a total amount due of:\n\n%(followup_amount).2f
93       %(company_currency)s\n\nThanks,\n--\n%(user_signature)s\n%(company_name)s'
94     email_subject: Invoices Reminder
95     partner_ids:
96       - base.res_partner_desertic_hispafuentes
97     partner_lang: 1
98
99
100 -
101   I clicked on Print Follow Ups to print Followups reports
102 -
103   !python {model: account.followup.print.all}: |
104     import time
105     self.do_print(cr, uid, [ref("account_followup_print_all_0")], {"lang": 'en_US',
106       "active_model": "ir.ui.menu", "active_ids": [ref("account_followup.account_followup_print_menu")],
107       "tz": False, "date": time.strftime('%Y-%m-%d'), "followup_id": ref("account_followup_followup_testfollowups0"), "active_id": ref("account_followup.account_followup_print_menu"),
108       })