[IMP] solve yml issues
authorRandhir Mayatra rma-openerp <rma@tinyerp.com>
Tue, 22 Apr 2014 11:50:49 +0000 (17:20 +0530)
committerRandhir Mayatra rma-openerp <rma@tinyerp.com>
Tue, 22 Apr 2014 11:50:49 +0000 (17:20 +0530)
addons/crm/crm.py
addons/crm/crm_action_rule_demo.xml
addons/crm/test/crm_lead_cancel.yml
addons/crm/test/crm_lead_find_stage.yml
addons/crm/test/lead2opportunity2win.yml
addons/crm/test/lead2opportunity_assign_salesmen.yml

index 86350b4..f746893 100644 (file)
@@ -118,6 +118,9 @@ class crm_case_section(osv.osv):
             res[id]['monthly_open_leads'] = self.__get_bar_values(cr, uid, obj, lead_domain, ['create_date'], 'create_date_count', 'create_date', context=context)
             res[id]['monthly_planned_revenue'] = self.__get_bar_values(cr, uid, obj, opp_domain, ['planned_revenue', 'date_deadline'], 'planned_revenue', 'date_deadline', context=context)
         return res
+    def create(self, cr, uid, vals, context=None):
+        self._alias_model_name = 'crm.lead'
+        return super(crm_case_section, self).create(cr, uid, vals, context={'alias_model_name': self._alias_model_name})
 
     _columns = {
         'resource_calendar_id': fields.many2one('resource.calendar', "Working Time", help="Used to compute open days"),
index 8eac91c..2524132 100644 (file)
@@ -41,7 +41,7 @@
             <field name="condition">True</field>
             <field name="type">ir.actions.server</field>
             <field name="state">code</field>
-            <field name="code">sales_team = self.pool.get('ir.model.data').get_object(cr, uid, 'crm', 'section_sales_department')
+            <field name="code">sales_team = self.pool.get('ir.model.data').get_object(cr, uid, 'sale_team', 'section_sales_department')
 object.write({'section_id': sales_team.id})
             </field>
         </record>
index dd475d5..fa98f47 100644 (file)
@@ -5,7 +5,7 @@
     uid: 'crm_res_users_salesmanager'
 -
   !python {model: crm.lead}: |
-    section_id = self.pool.get('crm.case.section').create(cr, uid, {'name': "Phone Marketing", 'parent_id': ref("crm.crm_case_section_2")})
+    section_id = self.pool.get('crm.case.section').create(cr, uid, {'name': "Phone Marketing", 'parent_id': ref("sale_team.crm_case_section_2")})
     self.write(cr, uid, [ref("crm_case_1")], {'section_id': section_id})
 -
   Salesman check unqualified lead .
index b8a11a4..9fcff6a 100644 (file)
@@ -6,7 +6,7 @@
     name: 'Test lead new'
     partner_id: base.res_partner_1
     description: This is the description of the test new lead.
-    section_id: crm.section_sales_department
+    section_id: sale_team.section_sales_department
 -
   I check default stage of lead.
 -
index 0650838..c91768b 100644 (file)
@@ -65,7 +65,7 @@
 -
   !python {model: crm.lead2opportunity.partner.mass}: |
     context.update({'active_model': 'crm.lead', 'active_ids': [ref("crm_case_13"), ref("crm_case_2")], 'active_id': ref("crm_case_13")})
-    id = self.create(cr, uid, {'user_ids': [(6, 0, [ref('base.user_root')])], 'section_id': ref('crm.section_sales_department')}, context=context)
+    id = self.create(cr, uid, {'user_ids': [(6, 0, [ref('base.user_root')])], 'section_id': ref('sale_team.section_sales_department')}, context=context)
     self.mass_convert(cr, uid, [id], context=context)
 -
   Now I check first lead converted on opportunity.
index 76b35be..6206db3 100644 (file)
@@ -66,7 +66,7 @@
 -
   !python {model: crm.lead2opportunity.partner.mass}: |
     context.update({'active_model': 'crm.lead', 'active_ids': [ref("test_crm_lead_01"), ref("test_crm_lead_02"), ref("test_crm_lead_03"), ref("test_crm_lead_04"), ref("test_crm_lead_05"), ref("test_crm_lead_06")], 'active_id': ref("test_crm_lead_01")})
-    id = self.create(cr, uid, {'user_ids': [(6, 0, [ref('test_res_user_01'), ref('test_res_user_02'), ref('test_res_user_03'), ref('test_res_user_04')])], 'section_id': ref('crm.section_sales_department'), 'deduplicate': False, 'force_assignation': True}, context=context)
+    id = self.create(cr, uid, {'user_ids': [(6, 0, [ref('test_res_user_01'), ref('test_res_user_02'), ref('test_res_user_03'), ref('test_res_user_04')])], 'section_id': ref('sale_team.section_sales_department'), 'deduplicate': False, 'force_assignation': True}, context=context)
     self.mass_convert(cr, uid, [id], context=context)
 -
   The leads should now be opps with a salesman and a salesteam.  Also, salesmen should have been assigned following a round-robin method.