[FIX] crm: on_change_partner did not set the zip code in lead/opp
[odoo/odoo.git] / addons / sale_crm / test / sale_crm.yml
1 -
2   Make sure the main company has at least one shop.
3 -
4   !python {model: sale.shop}: |
5     company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
6     shop_ids = self.search(cr, uid, [('company_id', '=', company_id)])
7     if not shop_ids:
8         # take a shop, and assign it to the user's company
9         shop_ids = self.search(cr, uid, [])
10         if shop_ids:
11             self.write(cr, uid, [shop_ids[0]], {'company_id': company_id})
12 -
13   I open the wizard "Make sales".
14 -
15   !record {model: crm.make.sale, id: crm_make_sale_0}:
16     partner_id: base.res_partner_4
17 -
18   I convert opportunity into "Quotation".
19 -
20   !python {model: crm.make.sale}: |
21     crm_lead = self.pool.get('crm.lead')
22     crm = crm_lead.browse(cr, uid, ref("crm.crm_case_13"))
23     self.makeOrder(cr, uid, [ref("crm_make_sale_0")], {"active_ids": [crm.id],
24       "active_id": crm.id})
25 -
26   I check that reference number of "Quotation" in opportunity.
27 -
28   !python {model: crm.lead}: |
29     crm = self.browse(cr, uid, ref("crm.crm_case_13"))
30     assert crm.ref, "Quotation has not been created."