diff options
| author | Purnendu Singh (OpenERP) <psi@tinyerp.com> | 2012-05-15 18:29:09 +0530 |
|---|---|---|
| committer | Purnendu Singh (OpenERP) <psi@tinyerp.com> | 2012-05-15 18:29:09 +0530 |
| commit | 0a2fba04e36d2c2bb765d8ee9d72ba1653be3da1 (patch) | |
| tree | 693e340c87dde9b37273ccd6f1ff5c3fd6d91416 | |
| parent | 466aa9babc2ddf695de796860043d0668fc3de96 (diff) | |
| parent | bc651f3ddfc6f805e9f80636fff054d11e405f52 (diff) | |
[MERGE, IMP] crm_claim: Update YML test case as state and stage are dependent to each other now
bzr revid: psi@tinyerp.com-20120515125909-go6biqkkx1sbkvf8
| -rw-r--r-- | addons/crm_claim/crm_claim.py | 9 | ||||
| -rw-r--r-- | addons/crm_claim/test/process/claim.yml | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index 2fbc5a313be..2c2faacc677 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -60,10 +60,9 @@ class crm_claim(crm.crm_case, osv.osv): def _save_state(self, cr, uid, claim_id, field_name, field_value, arg, context=None): stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('state', '=', field_value)], context=context) if stage_ids: - self.write(cr, uid, claim_id, {'stage_id': stage_ids[0]}, context=context) + return self.write(cr, uid, claim_id, {'stage_id': stage_ids[0]}, context=context) else: - cr.execute("""UPDATE crm_claim SET state=%s WHERE id=%s""", (field_value, claim_id, )) - return True + return cr.execute("""UPDATE crm_claim SET state=%s WHERE id=%s""", (field_value, claim_id, )) _name = "crm.claim" _description = "Claim" @@ -104,8 +103,8 @@ class crm_claim(crm.crm_case, osv.osv): 'state': fields.function(_get_state, fnct_inv=_save_state, type='selection', selection=crm.AVAILABLE_STATES, string="State", readonly=True, store = { 'crm.claim': (lambda self, cr, uid, ids, c={}: ids, ['stage_id'], 10), - 'crm.claim.stage': (_get_stage, ['state'], 10) - }, + 'crm.case.stage': (_get_stage, ['state'], 10) + }, help='The state is set to \'Draft\', when a case is created.\ \nIf the case is in progress the state is set to \'Open\'.\ \nWhen the case is over, the state is set to \'Done\'.\ diff --git a/addons/crm_claim/test/process/claim.yml b/addons/crm_claim/test/process/claim.yml index e20436cd3c6..45ca7cf2962 100644 --- a/addons/crm_claim/test/process/claim.yml +++ b/addons/crm_claim/test/process/claim.yml @@ -30,7 +30,7 @@ claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')]) claim = self.browse(cr, uid, claim_ids[0]) 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" + assert claim.stage_id.id == ref("crm.stage_lead2"), "Claim is not in Qualification stage" - After complete all service from our side, I close this claim. - |
