From b7641ab3d213426e34cc2fdf7c423f4880aa415b Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 12:43:58 +0530 Subject: [PATCH] [IMP, REM] crm_claim: All changes done in claim.yml 1) Removed code of onchange_partner_id, onchange_partner_address_id, stage_change 2) Updated code only claim is open to close process 3) updated __openerp__.py bzr revid: ron@tinyerp.com-20111018071358-l5424dpckx7327n1 --- addons/crm_claim/__openerp__.py | 2 +- addons/crm_claim/test/process/claim.yml | 48 ++++++------------------- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py index ae493c5dac2..2fabcd4b100 100644 --- a/addons/crm_claim/__openerp__.py +++ b/addons/crm_claim/__openerp__.py @@ -48,7 +48,7 @@ automatically new claims based on incoming emails. 'demo_xml': [ 'crm_claim_demo.xml', ], - 'test': ['test/test_crm_claim.yml'], + 'test': ['test/process/claim.yml'], 'installable': True, 'active': False, 'certificate' : '00612027414703404749', diff --git a/addons/crm_claim/test/process/claim.yml b/addons/crm_claim/test/process/claim.yml index 9ee130329a7..b12698797cb 100644 --- a/addons/crm_claim/test/process/claim.yml +++ b/addons/crm_claim/test/process/claim.yml @@ -1,44 +1,18 @@ -- | - I check claims which contain customer claim information about document - related problem, product related problem. -- | - I start by creating new claims for Damaged product as Value Claims with priority High and specify - date of claim at which claim is created. - - !record {model: crm.claim, id: crm_claim_damagedproduct0}: - categ_id: crm_claim.categ_claim2 - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - email_from: info@balmerinc.be - name: 'Damaged product ' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - priority: '2' - section_id: crm.section_sales_department - -- | - I check that the claims is in 'draft' state. + I check claim which contain customer claim information about + product related problem. - - !assert {model: crm.claim, id: crm_claim_damagedproduct0}: - - state == 'draft' -- | - I can change that stage by next button right on it. -- - !python {model: crm.claim}: | - self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')]) -- | I make this claim as Open. - !python {model: crm.claim}: | - self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')]) -- | - I am changing partner Assigned to the Claim. + self.case_open(cr, uid, [ref('crm_case_claim04')]) + claim = self.browse(cr, uid, ref('crm_case_claim04')) + assert claim.state == "open", "Claim is not in Open state" + assert claim.stage_id.id == ref("crm.stage_lead1"), "Claim is not in New stage" +- + After complete all service from our side i close this claim. - !python {model: crm.claim}: | - self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], []) - self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], ref('base.res_partner_10')) -- | - I am changing partner Address to the Claim. -- - !python {model: crm.claim}: | - self.onchange_partner_address_id(cr, uid, [ref('crm_claim_damagedproduct0')], [], email = False) - + self.case_close(cr, uid, [ref('crm_case_claim04')]) + claim = self.browse(cr, uid, ref('crm_case_claim04')) + assert claim.state == "done", "Claim is not in close state"