[MERGE]: Merged lp:~openerp-dev/openobject-addons/trunk-configuration_wizard_improvem...
authorAtul Patel (OpenERP) <atp@tinyerp.com>
Sat, 9 Jun 2012 14:30:00 +0000 (20:00 +0530)
committerAtul Patel (OpenERP) <atp@tinyerp.com>
Sat, 9 Jun 2012 14:30:00 +0000 (20:00 +0530)
bzr revid: atp@tinyerp.com-20120609143000-n73f2kh0qutvau3z

1  2 
addons/base_setup/base_setup_views.xml
addons/crm_claim/res_config.py
addons/crm_claim/res_config_view.xml
addons/plugin_outlook/plugin_outlook.py
addons/plugin_thunderbird/plugin_thunderbird.py
addons/sale/res_config.py

@@@ -51,7 -51,7 +51,7 @@@
                      <button string="Cancel" special="cancel"/>
                  </header>
                  <sheet layout="auto">
-                     <group>
 -                    <group col="4">
++                    <group colspan="4" col="4">
                          <group name="config_sale" colspan="4"/>
  
                          <!-- this part is necessary to allow the plugins to extend the view -->
                          <group name="config_fetchmail" colspan="4" attrs="{'invisible': [('module_crm','=',False)]}">
                              <separator string="Emails"/>
                          </group>
-                         <field name="module_plugin_thunderbird" attrs="{'invisible': [('module_crm','=',False)]}"/>
--                        <newline/>
-                         <field name="module_plugin_outlook" attrs="{'invisible': [('module_crm','=',False)]}"/>
-                         <group name="config_crm" colspan="4"/>
++                            <newline/>
+                               <field name="module_plugin_thunderbird" attrs="{'invisible': [('module_crm','=',False)]}"/>
+                               <newline/>
+                               <field name="module_plugin_outlook" attrs="{'invisible': [('module_crm','=',False)]}"/>
+                         <group name="config_crm"/>
                      </group>
                  </sheet>
              </form>
@@@ -26,7 -26,7 +26,7 @@@ class crm_claim_settings(osv.osv_memory
      _inherit = ['sale.config.settings', 'fetchmail.config.settings']
  
      _columns = {
--        'fetchmail_claim': fields.boolean("Create Claims from Incoming Mails", readonly=True,
++        'fetchmail_claim': fields.boolean("Create Claims from Incoming Mails",
              fetchmail_model='crm.claim', fetchmail_name='Incoming Claims',
              help="""Allows you to configure your incoming mail server, and create claims from incoming emails."""),
      }
              <field name="priority" eval="12"/>       <!-- to put fetchmail_lead before fetchmail_claim -->
              <field name="arch" type="xml">
                  <group name="config_fetchmail" position="after">
 -                    <field name="fetchmail_claim" attrs="{'readonly': [('fetchmail_claim','=',False)]}"/>
 -                    <button colspan="2" type="object" name="configure_fetchmail_claim" string="Configure" icon="gtk-execute"/>
++                   <newline/>
 +                    <field name="fetchmail_claim"/>
-                     <button colspan="2" type="object" name="configure_fetchmail_claim" string="Configure" icon="gtk-execute"/>
++                    <group attrs="{'invisible': [('fetchmail_claim','=',False)]}">
++                        <button colspan="2" type="object" name="configure_fetchmail_claim" string="Configure" icon="gtk-execute"/>
++                    </group>
                  </group>
              </field>
          </record>
@@@ -34,17 -32,20 +32,20 @@@ class outlook_installer(osv.osv_memory)
          'name2':fields.char('Outlook Plug-in 64bits', size=64, readonly=True, help="outlook plug-in file. Save as this file and install this plug-in in outlook."),
          'description':fields.text('Description', readonly=True)
      }
-     _defaults = {
-         'name' : '/plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup32.msi',
-         'name2' : '/plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup64.msi',
-         'description' : """
- Click on icon next to the link above to download the installer either for 32 or 64 bits and execute it.
- System requirements:
-     1.  MS Outlook 2005 or above.
-     2.  MS .Net Framework 3.5 or above.
- """
-         }
+     
+     def default_get(self, cr, uid, fields, context=None):
+         res = {}
+         plugin_32bit_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')  + '/plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup32.msi'
+         plugin_64bit_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')  + '/plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup64.msi'
+         description = """
 -Click on icon next to the link above to download the installer either for 32 or 64 bits and execute it.
 -
 -System requirements:
 -    1.  MS Outlook 2005 or above.
 -    2.  MS .Net Framework 3.5 or above.
 -"""
++            Click on icon next to the link above to download the installer either for 32 or 64 bits and execute it.
++            
++            System requirements:
++                1.  MS Outlook 2005 or above.
++                2.  MS .Net Framework 3.5 or above.
++            """
+         res['name'] = plugin_32bit_url
+         res['name2'] = plugin_64bit_url
+         res['description'] = description
+         return res
  # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@@ -34,21 -34,24 +34,24 @@@ class plugin_thunderbird_installer(osv.
          'pdf_file':fields.char('Installation Manual', size=264, help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
          'description':fields.text('Description', readonly=True)
      }
+     def default_get(self, cr, uid, fields, context=None):
+         res = {}
+         plugin_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')  + '/plugin_thunderbird/static/openerp_plugin.xpi'
+         description = """
 -Thunderbird plugin installation:
 -    1.  Save the Thunderbird plug-in.
 -    2.  From the Thunderbird menubar: Tools ­> Add-ons -> Screwdriver/Wrench Icon -> Install add-on from file...
 -    4.  Select the plug-in (the file named openerp_plugin.xpi).
 -    5.  Click "Install Now".
 -    6.  Restart Thunderbird.
 -    7.  From the Thunderbird menubar: OpenERP -> Configuration.
 -    8.  Configure your openerp server.
 -"""
++            Thunderbird plugin installation:
++                1.  Save the Thunderbird plug-in.
++                2.  From the Thunderbird menubar: Tools ­> Add-ons -> Screwdriver/Wrench Icon -> Install add-on from file...
++                4.  Select the plug-in (the file named openerp_plugin.xpi).
++                5.  Click "Install Now".
++                6.  Restart Thunderbird.
++                7.  From the Thunderbird menubar: OpenERP -> Configuration.
++                8.  Configure your openerp server.
++            """
+         res['thunderbird'] = True,
+         res['name'] = 'openerp_plugin.xpi'
+         res['plugin_file'] = plugin_url
+         res['pdf_file'] = 'http://doc.openerp.com/book/2/2_6_Comms/2_6_Comms_thunderbird.html',
+         res['description'] = description
+         return res
  
-     _defaults = {
-         'thunderbird' : True,
-         'name' : 'openerp_plugin.xpi',
-         'pdf_file' : 'http://doc.openerp.com/book/2/2_6_Comms/2_6_Comms_thunderbird.html',
-         'plugin_file' : '/plugin_thunderbird/static/openerp_plugin.xpi',
-         'description' : """
- Thunderbird plugin installation:
-     1.  Save the Thunderbird plug-in.
-     2.  From the Thunderbird menubar: Tools ­> Add-ons -> Screwdriver/Wrench Icon -> Install add-on from file...
-     4.  Select the plug-in (the file named openerp_plugin.xpi).
-     5.  Click "Install Now".
-     6.  Restart Thunderbird.
-     7.  From the Thunderbird menubar: OpenERP -> Configuration.
-     8.  Configure your openerp server.
- """
-     }
+ # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@@ -101,9 -101,16 +101,18 @@@ class sale_configuration(osv.osv_memory
          'module_project_timesheet': fields.boolean("Project Timesheet"),
          'module_project_mrp': fields.boolean("Project MRP"),
          'module_project': fields.boolean("Project"),
 -        'decimal_precision': fields.integer('Decimal Precision on Price'),
 +        'decimal_precision': fields.integer('Decimal Precision on Price',help="As an example, a decimal precision of 2 will allow prices  like: 9.99 EUR, whereas a decimal precision of 4 will allow prices like:  0.0231 EUR per unit."),
      }
+     def _check_decimal(self, cr, uid, ids, context=None):
 -        decimal = self.browse(cr, uid, ids, context=context)[0].decimal_precision
 -        if decimal > 20:
 -            return False
++        for decimal in self.browse(cr, uid, ids, context=context):
++            if decimal.decimal_precision > 20:
++                return False
+         return True
++    
+     _constraints = [
 -        (_check_decimal, 'Digits must be between 0 and  20 ', ['decimal_precision']),
++        (_check_decimal, 'Digits must be between 0 to 20 ', ['decimal_precision']),
+     ]
++    
      def default_get(self, cr, uid, fields, context=None):
          ir_model_data = self.pool.get('ir.model.data')
          res = super(sale_configuration, self).default_get(cr, uid, fields, context)