← Back to team overview

openerp-dev-web team mailing list archive

lp:~openerp-dev/openobject-server/trunk-rework-21Apr-server-aag into lp:openobject-server

 

Atik Agewan(OpenERP) has proposed merging lp:~openerp-dev/openobject-server/trunk-rework-21Apr-server-aag into lp:openobject-server.

Requested reviews:
  Rucha (Open ERP) (rpa-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-rework-21Apr-server-aag/+merge/59020

Mind About Config Applicaton -Server Side
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-rework-21Apr-server-aag/+merge/59020
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-server/trunk-rework-21Apr-server-aag.
=== modified file 'openerp/addons/base/base_update.xml'
--- openerp/addons/base/base_update.xml	2011-01-06 17:38:28 +0000
+++ openerp/addons/base/base_update.xml	2011-04-26 06:22:35 +0000
@@ -180,6 +180,7 @@
                 </search>
             </field>
         </record>
+        
         <!--
     ======================
     Company
@@ -201,9 +202,7 @@
                             <field name="rml_header1" colspan="4"/>
                             <field name="rml_footer1" colspan="4"/>
                             <field name="rml_footer2" colspan="4"/>
-                            <field name="currency_id"/>
-                            <separator colspan="4" string="Your Logo - Use a size of about 450x150 pixels."/>
-                            <field colspan="4" name="logo" widget="image"/>
+                            <field name="currency_id" colspan="2"/>
                         </page>
                         <page string="Header/Footer" groups="base.group_extended">
                             <field colspan="4" name="rml_header" nolabel="1"/>
@@ -349,13 +348,15 @@
         <record id="config_wizard_step_user" model="ir.actions.todo">
             <field name="action_id" ref="action_config_user_form"/>
             <field name="sequence">10</field>
-            <field name="restart">never</field>
+            <field name="type">normal</field>
             <field name="state">done</field>
         </record>
         <record id="config_wizard_simple_view" model="ir.actions.todo">
             <field name="action_id" ref="action_config_simple_view_form"/>
-            <field name="restart">always</field>
+            <field name="type">special</field>
             <field name="sequence">1</field>
+            <field name="state">skip</field>
         </record>
+        
     </data>
 </openerp>

=== modified file 'openerp/addons/base/ir/ir.xml'
--- openerp/addons/base/ir/ir.xml	2011-03-30 15:33:21 +0000
+++ openerp/addons/base/ir/ir.xml	2011-04-26 06:22:35 +0000
@@ -1878,7 +1878,7 @@
                 <tree editable="bottom" string="Config Wizard Steps">
                     <field name="sequence"/>
                     <field name="action_id"/>
-                    <field name="restart"/>
+                    <field name="type"/>
                     <field name="state" readonly="1"/>
                     <button name="action_launch" states="open" string="Launch" type="object" icon="gtk-execute" help="Launch Configuration Wizard"/>
                     <button name="action_open" states="cancel,skip,done"
@@ -1896,7 +1896,7 @@
                 <form editable="bottom" string="Config Wizard Steps">
                     <group colspan="4" col="6">
                         <field name="action_id"/>
-                        <field name="restart"/>
+                        <field name="type"/>
                         <field name="sequence"/>
                     </group>
                     <separator string="Groups" colspan="4"/>
@@ -1918,10 +1918,11 @@
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Actions">
-                    <filter string="To Do" name="todo" icon="terp-camera_test" domain=" ['|',('state','=','open'),'&amp;',('state','=','skip'),('restart','=','onskip')]" help="Todo State Or (Skip State And Onskip Restart)"/>
+                    <filter string="To Do" name="todo" icon="terp-camera_test" domain=" [('state','=','open')]" help="Wizards to be Launched"/>
                     <separator orientation="vertical"/>
+                    <field name="action_id"/>
                     <field name="state"/>
-                    <field name="restart"/>
+                    <field name="type"/>
                 </search>
             </field>
         </record>

=== modified file 'openerp/addons/base/ir/ir_actions.py'
--- openerp/addons/base/ir/ir_actions.py	2011-04-01 12:48:52 +0000
+++ openerp/addons/base/ir/ir_actions.py	2011-04-26 06:22:35 +0000
@@ -815,14 +815,14 @@
         'sequence': fields.integer('Sequence'),
         'state': fields.selection(TODO_STATES, string='State', required=True),
         'name':fields.char('Name', size=64),
-        'restart': fields.selection([('onskip','On Skip'),('always','Always'),('never','Never')],'Restart',required=True),
+        'type': fields.selection([('special','Special'),('normal','Normal'),('normal_recurring','Normal Recurring')],'Type',required=True),
         'groups_id':fields.many2many('res.groups', 'res_groups_action_rel', 'uid', 'gid', 'Groups'),
         'note':fields.text('Text', translate=True),
     }
     _defaults={
         'state': 'open',
         'sequence': 10,
-        'restart': 'onskip',
+        'type': 'special',
     }
     _order="sequence,name,id"
 
@@ -832,8 +832,8 @@
             context = {}
         wizard_id = ids and ids[0] or False
         wizard = self.browse(cr, uid, wizard_id, context=context)
-        res = self.pool.get('ir.actions.act_window').read(cr, uid, wizard.action_id.id, ['name', 'view_type', 'view_mode', 'res_model', 'context', 'views', 'type'], context=context)
-        res.update({'target':'new', 'nodestroy': True})
+        res = self.pool.get('ir.actions.act_window').read(cr, uid, wizard.action_id.id, ['name', 'view_type', 'view_mode', 'res_model', 'context', 'views', 'type','target'], context=context)
+        res.update({'nodestroy': True})
         return res
 
     def action_open(self, cr, uid, ids, context=None):

=== modified file 'openerp/addons/base/module/module.py'
--- openerp/addons/base/module/module.py	2011-01-13 09:41:00 +0000
+++ openerp/addons/base/module/module.py	2011-04-26 06:22:35 +0000
@@ -286,7 +286,17 @@
         return demo
 
     def button_install(self, cr, uid, ids, context=None):
-        return self.state_update(cr, uid, ids, 'to install', ['uninstalled'], context)
+        self.state_update(cr, uid, ids, 'to install', ['uninstalled'], context)
+        return {
+            'name': _('Install'),
+            'view_type': 'form',
+            'view_mode': 'form',
+            'res_model': 'base.module.upgrade',
+            'target': 'new',
+            'type': 'ir.actions.act_window',
+            'nodestroy':True,
+        }
+        
 
     def button_install_cancel(self, cr, uid, ids, context=None):
         self.write(cr, uid, ids, {'state': 'uninstalled', 'demo':False})
@@ -306,7 +316,15 @@
             if res:
                 raise orm.except_orm(_('Error'), _('Some installed modules depend on the module you plan to Uninstall :\n %s') % '\n'.join(map(lambda x: '\t%s: %s' % (x[0], x[1]), res)))
         self.write(cr, uid, ids, {'state': 'to remove'})
-        return True
+        return {
+            'name': _('Uninstall'),
+            'view_type': 'form',
+            'view_mode': 'form',
+            'res_model': 'base.module.upgrade',
+            'target': 'new',
+            'type': 'ir.actions.act_window',
+            'nodestroy':True,
+        }
 
     def button_uninstall_cancel(self, cr, uid, ids, context=None):
         self.write(cr, uid, ids, {'state': 'installed'})
@@ -343,7 +361,16 @@
                     to_install.extend(ids2)
 
         self.button_install(cr, uid, to_install, context=context)
-        return True
+        return {
+            'name': _('Upgrade'),
+            'view_type': 'form',
+            'view_mode': 'form',
+            'res_model': 'base.module.upgrade',
+            'target': 'new',
+            'type': 'ir.actions.act_window',
+            'nodestroy':True,
+        }
+#        return True
 
     def button_upgrade_cancel(self, cr, uid, ids, context=None):
         self.write(cr, uid, ids, {'state': 'installed'})

=== modified file 'openerp/addons/base/module/module_view.xml'
--- openerp/addons/base/module/module_view.xml	2011-01-04 10:18:47 +0000
+++ openerp/addons/base/module/module_view.xml	2011-04-26 06:22:35 +0000
@@ -112,7 +112,7 @@
                             <newline/>
                             <field name="state" readonly="1" select="1"/>
                             <group col="6" colspan="2">
-                                <button name="button_install" states="uninstalled" string="Schedule for Installation" icon="terp-gtk-jump-to-ltr" type="object"/>
+                                <button name="button_install" states="uninstalled" string="Install" icon="terp-gtk-jump-to-ltr" type="object"/>
                                 <button name="button_install_cancel" states="to install" string="Cancel Install" icon="gtk-cancel" type="object"/>
                                 <button name="button_uninstall" states="installed" string="Uninstall (beta)" icon="terp-dialog-close" type="object"/>
                                 <button name="button_uninstall_cancel" states="to remove" string="Cancel Uninstall" icon="gtk-cancel" type="object"/>
@@ -153,9 +153,9 @@
                     <field name="installed_version"/>
                     <field name="latest_version"/>
                     <field name="state"/>
-                    <button name="button_install" states="uninstalled" string="Schedule for Installation" icon="terp-gtk-jump-to-ltr" type="object"/>
+                    <button name="button_install" states="uninstalled" string="Install" icon="terp-gtk-jump-to-ltr" type="object"/>
                     <button name="button_install_cancel" states="to install" string="Cancel Install" icon="gtk-cancel" type="object"/>
-                    <button name="button_upgrade" states="installed" string="Schedule Upgrade" icon="terp-gtk-go-back-rtl" type="object"/>
+                    <button name="button_upgrade" states="installed" string="Upgrade" icon="terp-gtk-go-back-rtl" type="object"/>
                     <button name="button_uninstall" states="installed" string="Uninstall (beta)" icon="terp-dialog-close" type="object"/>
                     <button name="button_uninstall_cancel" states="to remove" string="Cancel Uninstall" icon="gtk-cancel" type="object"/>
                     <button name="button_upgrade_cancel" states="to upgrade" string="Cancel Upgrade" icon="gtk-cancel" type="object"/>
@@ -169,7 +169,7 @@
             <field name="view_mode">tree,form</field>
             <field name="domain"/>
             <field name="search_view_id" ref="view_module_filter"/>
-            <field name="help">You can install new modules in order to activate new features, menu, reports or data in your OpenERP instance. To install some modules, click on the button "Schedule for Installation" from the form view, then click on "Apply Scheduled Upgrades" to migrate your system.</field>
+            <field name="help">You can install new modules in order to activate new features, menu, reports or data in your OpenERP instance. To install some modules, click on the button "Install" from the form view and then click on "Start Upgrade".</field>
         </record>
         <menuitem action="open_module_tree" id="menu_module_tree" parent="base.menu_management"/>
 

=== modified file 'openerp/addons/base/module/wizard/base_module_configuration.py'
--- openerp/addons/base/module/wizard/base_module_configuration.py	2010-10-10 19:33:54 +0000
+++ openerp/addons/base/module/wizard/base_module_configuration.py	2011-04-26 06:22:35 +0000
@@ -27,7 +27,7 @@
     _name = "base.module.configuration"
 
     def start(self, cr, uid, ids, context=None):
-        todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', '|', ('restart','=','always'), ('state', '=', 'open'), '&', ('state', '=', 'skip'), ('restart', '=', 'onskip')])
+        todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', '|', ('type','=','normal_recurring'), ('state', '=', 'open'), '&', ('state', '=', 'skip'), ('type', '=', 'special')])
         if not todo_ids:
             # When there is no wizard todo it will display message
             data_obj = self.pool.get('ir.model.data')

=== modified file 'openerp/addons/base/module/wizard/base_module_configuration_view.xml'
--- openerp/addons/base/module/wizard/base_module_configuration_view.xml	2011-01-17 16:58:40 +0000
+++ openerp/addons/base/module/wizard/base_module_configuration_view.xml	2011-04-26 06:22:35 +0000
@@ -24,7 +24,7 @@
             <field name="code">action = obj.start()</field>
         </record>
 
-        <menuitem name="Reconfigure"
+        <menuitem name="Add More Features"
             action="action_start_configurator"
             id="menu_view_base_module_configuration" parent="base.menu_config"
             type="server" icon="STOCK_EXECUTE" sequence="100" />

=== modified file 'openerp/addons/base/module/wizard/base_module_upgrade_view.xml'
--- openerp/addons/base/module/wizard/base_module_upgrade_view.xml	2010-10-21 15:42:03 +0000
+++ openerp/addons/base/module/wizard/base_module_upgrade_view.xml	2011-04-26 06:22:35 +0000
@@ -36,7 +36,7 @@
         id="menu_view_base_module_upgrade"
        parent="menu_management"
        sequence="3"/>
-
+       
        <act_window id="action_view_base_module_upgrade_window"
             key2="client_action_multi" name="Apply Scheduled Upgrades"
             res_model="base.module.upgrade" src_model="ir.module.module"

=== modified file 'openerp/addons/base/res/partner/partner_view.xml'
--- openerp/addons/base/res/partner/partner_view.xml	2011-04-18 12:49:50 +0000
+++ openerp/addons/base/res/partner/partner_view.xml	2011-04-26 06:22:35 +0000
@@ -3,7 +3,9 @@
     <data>
         <menuitem icon="terp-partner" id="menu_base_partner" name="Sales" sequence="0"
                   web_icon="data/sales.png"
-                  web_icon_hover="data/sales-hover.png"/>
+                  web_icon_hover="data/sales-hover.png"
+                  groups="base.group_sale_salesman"/>
+                  
 
         <menuitem id="menu_address_book" name="Address Book" parent="menu_base_partner" sequence="2"/>
 

=== modified file 'openerp/addons/base/res/res_company.py'
--- openerp/addons/base/res/res_company.py	2011-03-03 10:52:39 +0000
+++ openerp/addons/base/res/res_company.py	2011-04-26 06:22:35 +0000
@@ -68,7 +68,6 @@
 
 multi_company_default()
 
-
 class res_company(osv.osv):
     _name = "res.company"
     _description = 'Companies'
@@ -138,6 +137,26 @@
             return []
         ids =  self.search(cr, uid, [('parent_id','child_of',[company])])
         return ids
+    
+#  For Report
+
+    def createReport(cr, uid, report, ids, name=False):
+        files = []
+        for id in ids:
+            try:
+                service = netsvc.LocalService(report)
+                (result, format) = service.create(cr, uid, [id], {}, {})
+                if not name:
+                    report_file = '/tmp/reports'+ str(id) + '.pdf'
+                else:
+                    report_file = name
+                fp = open(report_file,'wb+')
+                fp.write(result);
+                fp.close();
+                files += [report_file]    
+            except Exception,e:
+                continue        
+        return files
 
     def _get_partner_hierarchy(self, cr, uid, company_id, context={}):
         if company_id:

=== modified file 'openerp/addons/base/res/res_config.py'
--- openerp/addons/base/res/res_config.py	2011-02-03 23:00:23 +0000
+++ openerp/addons/base/res/res_config.py	2011-04-26 06:22:35 +0000
@@ -66,6 +66,7 @@
     def _next_action(self, cr, uid, context=None):
         todos = self.pool.get('ir.actions.todo')
         self.__logger.info('getting next %s', todos)
+        # Don't forget to change the domain in search view, if this condition is changed
         active_todos = todos.search(cr, uid, [('state','=','open')],
                                     limit=1)
         if active_todos:
@@ -120,7 +121,7 @@
     def start(self, cr, uid, ids, context=None):
         ids2 = self.pool.get('ir.actions.todo').search(cr, uid, [], context=context)
         for todo in self.pool.get('ir.actions.todo').browse(cr, uid, ids2, context=context):
-            if (todo.restart=='always') or (todo.restart=='onskip' and (todo.state in ('skip','cancel'))):
+            if (todo.type=='normal_recurring'):
                 todo.write({'state':'open'})
         return self.next(cr, uid, ids, context)
 

=== modified file 'openerp/addons/base/res/res_config.xml'
--- openerp/addons/base/res/res_config.xml	2010-12-29 20:12:50 +0000
+++ openerp/addons/base/res/res_config.xml	2011-04-26 06:22:35 +0000
@@ -69,7 +69,7 @@
             <separator string="vsep" orientation="vertical" colspan="1" rowspan="12"/>
             <group colspan="6">
               <separator string="title" colspan="4"/>
-              <group colspan="8"/>
+              <group colspan="8" col="2"/>
             </group>
           </group>
           <group colspan="8" col="8">

=== modified file 'openerp/addons/base/security/base_security.xml'
--- openerp/addons/base/security/base_security.xml	2011-03-03 15:59:18 +0000
+++ openerp/addons/base/security/base_security.xml	2011-04-26 06:22:35 +0000
@@ -29,12 +29,13 @@
         <field name="name">Useability / No One</field>
     </record>
 
-    <record id="group_sale_manager" model="res.groups">
+    <record id="group_sale_manager" context="{'noadmin':True}" model="res.groups">
         <field name="name">Sales / Manager</field>
     </record>
-    <record id="group_sale_salesman" model="res.groups">
+    <record id="group_sale_salesman" context="{'noadmin':True}" model="res.groups">
         <field name="name">Sales / User</field>
     </record>
+
     <!-- Set accesses to menu -->
     <record model="ir.ui.menu" id="base.menu_administration">
         <field name="groups_id" eval="[(6,0, [ref('group_system'), ref('group_erp_manager')])]"/>


Follow ups