[MERGE] merge with latest stable
[odoo/odoo.git] / addons / base_contact / test / base_contact00.yml
1 -  |
2    I will test base_contact for following cases:
3     *contacts unrelated to a partner,
4     *contacts working at several addresses (possibly for different partners),
5     *contacts with possibly different functions for each of its job's addresses
6 -  |
7    In order to assign language to contacts first I will create Language FR
8    (Remove)
9
10     !record {model: res.lang, id: res_lang_french0}:
11       code: fr_BE
12       date_format: '%m/%d/%Y'
13       decimal_point: '.'
14       direction: ltr
15       grouping: '[]'
16       name: French
17       time_format: '%H:%M:%S'
18 -  |
19    In order to check contacts first I will create contact unrelated to a partner
20
21     !record {model: res.partner.contact, id: res_partner_contact_williams0}:
22         country_id: base.be
23         first_name: Laura
24         job_ids:
25             - email: lwilliams@mydomain.com
26               function: PA
27               phone: (+32).10.45.18.77
28               sequence_contact: 1
29               state: current
30         lang_id: res_lang_french0
31         mobile: (+32).10.45.18.77
32         name: Williams
33 -   |
34     Now in order to assign this contact to partner I will create one partner assign contact laura to this partner
35
36     !record {model: res.partner, id: res_partner_laurascompany0}:
37         address:
38             - city: Namur
39               country_id: base.be
40               phone: (+32).10.45.18.77
41               street: 23, street ways
42               type: default
43               zip: '2324324'
44               job_ids:
45                 - address_id: res_partner_address_1
46                   function: CEO
47                   contact_id: res_partner_contact_williams0
48                   sequence_partner: 2
49                   state: current
50         lang: fr_BE
51         name: Laura's Company
52         ref: LC
53
54 -   |
55     Now I will check that the new job is assigned properly to contact or not
56 -
57     !assert {model: res.partner.contact, id: res_partner_contact_williams0}:
58         - len(job_ids) >= 2
59 -   |
60     In order to check contacts working at several addresses for different partners
61     I will create contact with 2 different addresses
62
63   !record {model: res.partner.contact, id: res_partner_contact_pauwels0}:
64         country_id: base.be
65         first_name: Nicolas
66         job_ids:
67           - address_id: base.main_address
68             function: CTO
69             state: current
70           - address_id: base.res_partner_address_3000
71             function: CEO
72             state: current
73         lang_id: res_lang_french0
74         mobile: (+32).23.44.32.12
75         name: Pauwels
76
77 -   |
78     In order to check one contact working at one partner with different functions
79     I will create contact with 2 different jobs with different function but the same address
80
81   !record {model: res.partner.contact, id: res_partner_contact_mortier0}:
82     country_id: base.be
83     first_name: Christina
84     job_ids:
85       - address_id: base.res_partner_address_1
86         function: CEO
87         state: past
88       - address_id: base.res_partner_address_1
89         function: CTO
90         state: current
91     lang_id: base_contact.res_lang_french0
92     mobile: (+32).10.45.18.77
93     name: Mortier
94