Jalpesh Patel(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-auto_follow-atp-sales_auto_follow-pja 
into lp:~openerp-dev/openobject-addons/trunk-auto_follow-atp.

Requested reviews:
  Atul Patel(OpenERP) (atp-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-auto_follow-atp-sales_auto_follow-pja/+merge/125977

Hello,
     i have improve sales auto followers of opportunities or sale order created 
by sales belonging to the sales team.

Thanks!
pja
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-auto_follow-atp-sales_auto_follow-pja/+merge/125977
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-auto_follow-atp.
=== modified file 'crm/crm.py'
--- crm/crm.py	2012-09-13 08:38:25 +0000
+++ crm/crm.py	2012-09-24 11:12:18 +0000
@@ -102,6 +102,7 @@
     """ Model for sales teams. """
     _name = "crm.case.section"
     _inherits = {'mail.alias': 'alias_id'}
+    _inherit = 'mail.thread'
     _description = "Sales Teams"
     _order = "complete_name"
 

=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py	2012-09-20 07:38:24 +0000
+++ crm/crm_lead.py	2012-09-24 11:12:18 +0000
@@ -277,6 +277,9 @@
 
     def create(self, cr, uid, vals, context=None):
         obj_id = super(crm_lead, self).create(cr, uid, vals, context)
+        record = self.browse(cr, uid, obj_id, context=context)
+        followers = [follow.id for follow in record.section_id.message_follower_ids]
+        self.message_subscribe(cr, uid, [record.id],followers, context=context)
         self.create_send_note(cr, uid, [obj_id], context=context)
         return obj_id
 

=== modified file 'crm/crm_view.xml'
--- crm/crm_view.xml	2012-09-12 13:35:37 +0000
+++ crm/crm_view.xml	2012-09-24 11:12:18 +0000
@@ -115,6 +115,10 @@
                             <field name="note"/>
                         </page>
                     </notebook>
+                    <div class="oe_chatter">
+                        <field name="message_ids" widget="mail_thread"/>
+                        <field name="message_follower_ids" widget="mail_followers"/>
+                    </div>
                 </form>
             </field>
         </record>

=== modified file 'sale/sale.py'
--- sale/sale.py	2012-09-21 09:35:20 +0000
+++ sale/sale.py	2012-09-24 11:12:18 +0000
@@ -286,6 +286,10 @@
 
     def create(self, cr, uid, vals, context=None):
         order =  super(sale_order, self).create(cr, uid, vals, context=context)
+        record = self.browse(cr, uid, order, context=context)
+        if record.section_id:
+            followers = [follow.id for follow in record.section_id.message_follower_ids]
+            self.message_subscribe(cr, uid, [record.id],followers, context=context)
         if order:
             self.create_send_note(cr, uid, [order], context=context)
         return order

=== modified file 'sale_crm/sale_crm.py'
--- sale_crm/sale_crm.py	2012-07-06 11:06:21 +0000
+++ sale_crm/sale_crm.py	2012-09-24 11:12:18 +0000
@@ -30,6 +30,16 @@
             domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
     }
 
+def create(self, cr, uid, vals, context=None):
+        order =  super(sale_order, self).create(cr, uid, vals, context=context)
+        record = self.browse(cr, uid, order, context=context)
+        if record.section_id:
+            followers = [follow.id for follow in record.section_id.message_follower_ids]
+            self.message_subscribe(cr, uid, [record.id],followers, context=context)
+        if order:
+            self.create_send_note(cr, uid, [order], context=context)
+        return order
+
 sale_order()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

_______________________________________________
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