2 Make sure the main company has at least one shop.
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)])
8 # take a shop, and assign it to the user's company
9 shop_ids = self.search(cr, uid, [])
11 self.write(cr, uid, [shop_ids[0]], {'company_id': company_id})
13 I open the wizard "Make sales".
15 !record {model: crm.make.sale, id: crm_make_sale_0}:
16 partner_id: base.res_partner_4
18 I convert opportunity into "Quotation".
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],
26 I check that reference number of "Quotation" in opportunity.
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."