[IMP] better view
authorFabien Pinckaers <fp@tinyerp.com>
Fri, 25 Jun 2010 17:28:51 +0000 (19:28 +0200)
committerFabien Pinckaers <fp@tinyerp.com>
Fri, 25 Jun 2010 17:28:51 +0000 (19:28 +0200)
bzr revid: fp@tinyerp.com-20100625172851-k4lsqh2qygxvt4aw

addons/crm/crm_lead.py
addons/crm/crm_lead_view.xml
addons/crm/wizard/crm_lead_to_opportunity.py
addons/mail_gateway/mail_gateway.py
addons/wiki/wizard/wiki_create_menu.py

index ea1929a..f6d3257 100644 (file)
@@ -37,7 +37,6 @@ class crm_lead(osv.osv, crm_case):
     _description = "Lead"
     _order = "priority, id desc"
     _inherit = ['mailgate.thread','res.partner.address']
-
     def _compute_day(self, cr, uid, ids, fields, args, context={}):
         """
         @param cr: the current row, from the database cursor,
index edbd4a1..4825c8c 100644 (file)
                     <field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
                         <form string="Communication history">
                             <group col="6" colspan="4">
-                                <field name="date"/>
-                                <field name="email_to"/>
                                 <field name="email_from"/>
+                                <field name="email_to"/>
+                                <field name="date"/>
+                                <field name="name" colspan="6"/>
                             </group>
                             <notebook colspan="4">
                                 <page string="Details">
index 00a2fb7..5560ec5 100644 (file)
@@ -83,6 +83,9 @@ class crm_lead2opportunity(osv.osv_memory):
             }
             lead_obj.write(cr, uid, lead.id, vals, context=context)
             lead_obj._history(cr, uid, [lead], _('Opportunity'), details='Converted to Opportunity', context=context)
+            if lead.partner_id:
+                msg_ids = [ x.id for x in lead.message_ids]
+                self.pool.get('mailgate.message').write(cr, uid, msg_ids, {'partner_id': lead.partner_id.id}, context=context)
 
         value = {
             'name': _('Opportunity'), 
index 4eb68b4..8c6e2a9 100644 (file)
@@ -127,7 +127,7 @@ class mailgate_message(osv.osv):
     _description = 'Mailgateway Message'
     _order = 'id desc'
     _columns = {
-        'name':fields.char('Message', size=64), 
+        'name':fields.char('Subject', size=128), 
         'model': fields.char('Object Name', size=128), 
         'res_id': fields.integer('Resource ID'),
         'ref_id': fields.char('Reference Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
index 0b242e6..2ad7821 100644 (file)
@@ -23,7 +23,6 @@ from osv import fields, osv
 
 class wiki_create_menu(osv.osv_memory):
     """ Create Menu """
-
     _name = "wiki.create.menu"
     _description = "Wizard Create Menu"
 
@@ -43,6 +42,12 @@ class wiki_create_menu(osv.osv_memory):
         """
         mod_obj = self.pool.get('ir.model.data')
         action_id = mod_obj._get_id(cr, uid, 'wiki', 'action_view_wiki_wiki_page_open')
+        print context
+        action_id = mod_obj.copy(cr, uid, action_id, context=context, default={
+            'domain':"[('group_id','=',"+str(context.get('active_id',False))+"]"
+
+
+        })
 
         for menu in self.browse(cr, uid, ids):
             menu_id = self.pool.get('ir.ui.menu').create(cr, uid, {
@@ -51,6 +56,7 @@ class wiki_create_menu(osv.osv_memory):
                             'icon': 'STOCK_DIALOG_QUESTION',
                             'action': 'ir.actions.act_window,'+ str(action_id)
                             }, context)
+            print 'Created menu', menu_id, action_id
             home = menu.page.id
             group_id = menu.id
             res = {