Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-state_sync_with_kanban-crm_claim-mma 
into lp:~openerp-dev/openobject-addons/trunk-state_sync_with_kanban.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-state_sync_with_kanban-crm_claim-mma/+merge/105640

Hello Sir

     crm_claim: I have improved code and demo data according to stage and state 
behavior

Thanks.
mma

 
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-state_sync_with_kanban-crm_claim-mma/+merge/105640
Your team OpenERP R&D Team is requested to review the proposed merge of 
lp:~openerp-dev/openobject-addons/trunk-state_sync_with_kanban-crm_claim-mma 
into lp:~openerp-dev/openobject-addons/trunk-state_sync_with_kanban.
=== modified file 'crm/crm_lead_data.xml'
--- crm/crm_lead_data.xml	2012-04-20 10:59:55 +0000
+++ crm/crm_lead_data.xml	2012-05-14 11:37:30 +0000
@@ -13,7 +13,7 @@
         <record model="crm.case.stage" id="stage_lead1">
             <field name="name">New</field>
             <field eval="1" name="case_default"/>
-            <field name="state">draft</field>
+            <field name="state">open</field>
             <field eval="'10'" name="probability"/>
             <field eval="'11'" name="sequence"/>
         </record>

=== modified file 'crm_claim/crm_claim.py'
--- crm_claim/crm_claim.py	2012-05-11 06:26:34 +0000
+++ crm_claim/crm_claim.py	2012-05-14 11:37:30 +0000
@@ -60,10 +60,9 @@
     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,7 +103,7 @@
         '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\'.\

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to