From f672183ff142178f78df8ec70686bb9ff43057c3 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Tue, 1 Mar 2011 12:51:34 +0530 Subject: [PATCH 001/442] [IMP] Rework-Addons :Improvement Config wiz , ON Addonse Side bzr revid: aag@tinyerp.co.in-20110301072134-3rrx10e53csav102 --- addons/account/account_installer.xml | 4 +-- .../account_sequence_installer_view.xml | 2 +- addons/base_setup/base_setup_todo.xml | 2 +- addons/base_setup/installer.py | 33 +++++++++++++++++++ addons/crm/crm_installer_view.xml | 2 +- .../wizard/document_configuration_view.xml | 2 +- addons/hr/hr_installer.xml | 2 +- addons/knowledge/knowledge_installer.xml | 2 +- addons/l10n_be/l10n_be_wizard.xml | 2 +- .../data/l10n_br_account_chart_template.xml | 2 +- addons/l10n_cr/l10n_wizard.xml | 2 +- addons/l10n_es/l10n_es_wizard.xml | 2 +- addons/l10n_fr/l10n_fr_wizard.xml | 2 +- addons/l10n_lu/l10n_lu_wizard.xml | 2 +- addons/l10n_ma/l10n_ma_wizard.xml | 2 +- addons/l10n_uk/l10n_uk_wizard.xml | 2 +- addons/mrp/mrp_installer.xml | 2 +- addons/profile_tools/misc_tools_installer.xml | 2 +- addons/project/project_installer.xml | 2 +- .../purchase_double_validation_installer.xml | 2 +- .../report_designer_installer.xml | 2 +- addons/sale/sale_installer.xml | 2 +- 22 files changed, 55 insertions(+), 22 deletions(-) diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml index 6ebdf74b977..7e3836340b9 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -116,13 +116,13 @@ 3 - onskip + on_trigger 5 - always + on_trigger diff --git a/addons/account_sequence/account_sequence_installer_view.xml b/addons/account_sequence/account_sequence_installer_view.xml index 1051b133045..3a812a187c4 100644 --- a/addons/account_sequence/account_sequence_installer_view.xml +++ b/addons/account_sequence/account_sequence_installer_view.xml @@ -50,7 +50,7 @@ 3 - onskip + on_trigger diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml index 7cd0563aafe..c3a1bc24a8b 100644 --- a/addons/base_setup/base_setup_todo.xml +++ b/addons/base_setup/base_setup_todo.xml @@ -67,7 +67,7 @@ 1 - onskip + on_trigger diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py index e23f1171752..bb2626a59ae 100644 --- a/addons/base_setup/installer.py +++ b/addons/base_setup/installer.py @@ -19,6 +19,7 @@ # ############################################################################## from osv import fields, osv +import re class base_setup_installer(osv.osv_memory): _name = 'base.setup.installer' @@ -101,5 +102,37 @@ class base_setup_installer(osv.osv_memory): value.update({'progress':progress}) if progress < 10.: progress = 10. + return {'value':value} + + def execute(self, cr, uid, ids, context=None): + if context is None: + context = {} + modules = self.pool.get('ir.module.module') + modules_selected = [] + datas = self.read(cr, uid, ids, context=context)[0] + key = datas.keys() + key.remove("id") + key.remove("progress") + name_list = [] + for mod in key: + if datas[mod] == 1: + modules_selected.append(mod) + inst = modules.browse( + cr, uid, + modules.search(cr, uid, + [('name','in',modules_selected) + ], + context=context), + context=context) + for i in inst: + if i.state == 'uninstalled': + sect_mod_id = i.id + modules.button_install(cr, uid, [sect_mod_id], context=context) + elif i.state == 'installed': + if modules_selected: + for instl in modules_selected: + cr.execute("update ir_actions_todo set restart='on_trigger' , state='open' from ir_model_data as data where data.res_id = ir_actions_todo.id and data.model = 'ir.actions.todo' and data.module like '%"+instl+"%'") + + return base_setup_installer() diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml index 35ff5a0a7cc..778ebd5646a 100644 --- a/addons/crm/crm_installer_view.xml +++ b/addons/crm/crm_installer_view.xml @@ -61,7 +61,7 @@ 3 - always + on_trigger diff --git a/addons/document/wizard/document_configuration_view.xml b/addons/document/wizard/document_configuration_view.xml index 156af432b0e..8aa874782b9 100644 --- a/addons/document/wizard/document_configuration_view.xml +++ b/addons/document/wizard/document_configuration_view.xml @@ -46,7 +46,7 @@ - + diff --git a/addons/hr/hr_installer.xml b/addons/hr/hr_installer.xml index 5ccbaefa3f5..3d04abf00e3 100644 --- a/addons/hr/hr_installer.xml +++ b/addons/hr/hr_installer.xml @@ -52,7 +52,7 @@ 3 - always + on_trigger diff --git a/addons/knowledge/knowledge_installer.xml b/addons/knowledge/knowledge_installer.xml index 068fa9b413b..79f6cfb178e 100644 --- a/addons/knowledge/knowledge_installer.xml +++ b/addons/knowledge/knowledge_installer.xml @@ -53,7 +53,7 @@ 3 - always + on_trigger diff --git a/addons/l10n_be/l10n_be_wizard.xml b/addons/l10n_be/l10n_be_wizard.xml index 0e691260425..5b3c42b22fa 100644 --- a/addons/l10n_be/l10n_be_wizard.xml +++ b/addons/l10n_be/l10n_be_wizard.xml @@ -4,7 +4,7 @@ - onskip + on_trigger diff --git a/addons/l10n_br/data/l10n_br_account_chart_template.xml b/addons/l10n_br/data/l10n_br_account_chart_template.xml index dd714bacab8..4b548f65c8c 100644 --- a/addons/l10n_br/data/l10n_br_account_chart_template.xml +++ b/addons/l10n_br/data/l10n_br_account_chart_template.xml @@ -19,7 +19,7 @@ This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. open - onskip + on_trigger diff --git a/addons/l10n_cr/l10n_wizard.xml b/addons/l10n_cr/l10n_wizard.xml index 0e691260425..5b3c42b22fa 100644 --- a/addons/l10n_cr/l10n_wizard.xml +++ b/addons/l10n_cr/l10n_wizard.xml @@ -4,7 +4,7 @@ - onskip + on_trigger diff --git a/addons/l10n_es/l10n_es_wizard.xml b/addons/l10n_es/l10n_es_wizard.xml index 294f0a5e668..3bbda51e00c 100644 --- a/addons/l10n_es/l10n_es_wizard.xml +++ b/addons/l10n_es/l10n_es_wizard.xml @@ -4,7 +4,7 @@ - onskip + on_trigger diff --git a/addons/l10n_fr/l10n_fr_wizard.xml b/addons/l10n_fr/l10n_fr_wizard.xml index 985c3b81195..48147ac172d 100644 --- a/addons/l10n_fr/l10n_fr_wizard.xml +++ b/addons/l10n_fr/l10n_fr_wizard.xml @@ -4,7 +4,7 @@ - onskip + on_trigger diff --git a/addons/l10n_lu/l10n_lu_wizard.xml b/addons/l10n_lu/l10n_lu_wizard.xml index f0655f3dc99..5942e7800d0 100644 --- a/addons/l10n_lu/l10n_lu_wizard.xml +++ b/addons/l10n_lu/l10n_lu_wizard.xml @@ -4,7 +4,7 @@ - onskip + on_trigger diff --git a/addons/l10n_ma/l10n_ma_wizard.xml b/addons/l10n_ma/l10n_ma_wizard.xml index 4524c36fb10..4768ed60dee 100644 --- a/addons/l10n_ma/l10n_ma_wizard.xml +++ b/addons/l10n_ma/l10n_ma_wizard.xml @@ -4,7 +4,7 @@ - onskip + on_trigger diff --git a/addons/l10n_uk/l10n_uk_wizard.xml b/addons/l10n_uk/l10n_uk_wizard.xml index 63a56521bd8..62fe38a1642 100644 --- a/addons/l10n_uk/l10n_uk_wizard.xml +++ b/addons/l10n_uk/l10n_uk_wizard.xml @@ -8,7 +8,7 @@ This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. open - onskip + on_trigger diff --git a/addons/mrp/mrp_installer.xml b/addons/mrp/mrp_installer.xml index ff0c01f8e18..4008385ff32 100644 --- a/addons/mrp/mrp_installer.xml +++ b/addons/mrp/mrp_installer.xml @@ -48,7 +48,7 @@ 3 - always + on_trigger diff --git a/addons/profile_tools/misc_tools_installer.xml b/addons/profile_tools/misc_tools_installer.xml index 235d2d6e392..c21f703b291 100644 --- a/addons/profile_tools/misc_tools_installer.xml +++ b/addons/profile_tools/misc_tools_installer.xml @@ -48,7 +48,7 @@ - always + on_trigger 3 diff --git a/addons/project/project_installer.xml b/addons/project/project_installer.xml index 32b235e4691..7200986beb2 100644 --- a/addons/project/project_installer.xml +++ b/addons/project/project_installer.xml @@ -50,7 +50,7 @@ - always + on_trigger 3 diff --git a/addons/purchase_double_validation/purchase_double_validation_installer.xml b/addons/purchase_double_validation/purchase_double_validation_installer.xml index c3369f68554..2cafbd7cd9a 100644 --- a/addons/purchase_double_validation/purchase_double_validation_installer.xml +++ b/addons/purchase_double_validation/purchase_double_validation_installer.xml @@ -44,7 +44,7 @@ - onskip + on_trigger diff --git a/addons/report_designer/report_designer_installer.xml b/addons/report_designer/report_designer_installer.xml index 2f838c0b74c..31f6d16ae22 100644 --- a/addons/report_designer/report_designer_installer.xml +++ b/addons/report_designer/report_designer_installer.xml @@ -45,7 +45,7 @@ - always + on_trigger 3 diff --git a/addons/sale/sale_installer.xml b/addons/sale/sale_installer.xml index 4149871ad36..ad707a1abec 100644 --- a/addons/sale/sale_installer.xml +++ b/addons/sale/sale_installer.xml @@ -47,7 +47,7 @@ - always + on_trigger 3 From 43690eb21f88759f76f591247f43cf6aa548e611 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Tue, 1 Mar 2011 12:52:41 +0530 Subject: [PATCH 002/442] [IMP] REWORK-SERVERSIDE :Improvement Config wiz , ON SERVER SIDE bzr revid: aag@tinyerp.co.in-20110301072241-a8s1iialq6xeot23 --- openerp/addons/base/ir/ir.xml | 2 +- openerp/addons/base/ir/ir_actions.py | 4 +-- .../wizard/base_module_configuration_view.xml | 2 +- .../addons/base/res/partner/partner_view.xml | 4 ++- openerp/addons/base/res/res_config.py | 31 +------------------ 5 files changed, 8 insertions(+), 35 deletions(-) diff --git a/openerp/addons/base/ir/ir.xml b/openerp/addons/base/ir/ir.xml index a7e9922331b..d1917a4a52f 100644 --- a/openerp/addons/base/ir/ir.xml +++ b/openerp/addons/base/ir/ir.xml @@ -1908,7 +1908,7 @@ search - + diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index 7a07ca40ef8..1d73ad70171 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -794,14 +794,14 @@ class ir_actions_todo(osv.osv): '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), + 'restart': fields.selection([('on_trigger','On Trigger'),('always','Always'),('never','Never')],'Restart',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', + 'restart': 'on_trigger', } _order="sequence,name,id" diff --git a/openerp/addons/base/module/wizard/base_module_configuration_view.xml b/openerp/addons/base/module/wizard/base_module_configuration_view.xml index f8abf1e2732..be86145a156 100644 --- a/openerp/addons/base/module/wizard/base_module_configuration_view.xml +++ b/openerp/addons/base/module/wizard/base_module_configuration_view.xml @@ -24,7 +24,7 @@ action = obj.start() - diff --git a/openerp/addons/base/res/partner/partner_view.xml b/openerp/addons/base/res/partner/partner_view.xml index 9d46404132c..e32e73deedb 100644 --- a/openerp/addons/base/res/partner/partner_view.xml +++ b/openerp/addons/base/res/partner/partner_view.xml @@ -3,7 +3,9 @@ + web_icon_hover="data/sales-hover.png" + groups="base.group_sale_salesman,base.group_sale_salesman"/> + diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 3f8c6f20b8d..2f0b5c44509 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -120,7 +120,7 @@ class res_config_configurable(osv.osv_memory): 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.restart=='always') or (todo.restart=='on_trigger' and (todo.state in ('skip','cancel'))): todo.write({'state':'open'}) return self.next(cr, uid, ids, context) @@ -355,35 +355,6 @@ class res_config_installer(osv.osv_memory): return (base | hooks_results | additionals) - set( map(attrgetter('name'), self._already_installed(cr, uid, context))) - def default_get(self, cr, uid, fields_list, context=None): - ''' If an addon is already installed, check it by default - ''' - defaults = super(res_config_installer, self).default_get( - cr, uid, fields_list, context=context) - - return dict(defaults, - **dict.fromkeys( - map(attrgetter('name'), - self._already_installed(cr, uid, context=context)), - True)) - - def fields_get(self, cr, uid, fields=None, context=None, write_access=True): - """ If an addon is already installed, set it to readonly as - res.config.installer doesn't handle uninstallations of already - installed addons - """ - fields = super(res_config_installer, self).fields_get( - cr, uid, fields, context, write_access) - - for module in self._already_installed(cr, uid, context=context): - if module.name not in fields: - continue - fields[module.name].update( - readonly=True, - help= ustr(fields[module.name].get('help', '')) + - _('\n\nThis addon is already installed on your system')) - return fields - def execute(self, cr, uid, ids, context=None): modules = self.pool.get('ir.module.module') to_install = list(self.modules_to_install( From 73378da514dd636ddafcd6ca4d552ae9db637efe Mon Sep 17 00:00:00 2001 From: sus Date: Tue, 1 Mar 2011 13:10:35 +0530 Subject: [PATCH 003/442] [IMP] : Improvement in server(module.py file) bzr revid: sus@sus-desktop-20110301074035-7fx0v3gv8889slbb --- openerp/addons/__init__.py | 2 +- openerp/addons/base/module/module.py | 58 ++++++++++++++----- openerp/addons/base/module/module_view.xml | 2 +- .../base/module/wizard/base_module_upgrade.py | 31 ---------- .../wizard/base_module_upgrade_view.xml | 16 ++--- openerp/addons/base/res/res_user.py | 1 - 6 files changed, 50 insertions(+), 60 deletions(-) diff --git a/openerp/addons/__init__.py b/openerp/addons/__init__.py index af080724136..ee6cd5eba49 100644 --- a/openerp/addons/__init__.py +++ b/openerp/addons/__init__.py @@ -843,7 +843,7 @@ def load_modules(db, force_demo=False, status=None, update_module=False): if 'base' in tools.config['update'] or 'all' in tools.config['update']: cr.execute("update ir_module_module set state=%s where name=%s and state=%s", ('to upgrade', 'base', 'installed')) - # STEP 1: LOAD BASE (must be done before module dependencies can be computed for later steps) + # STEP 1: LOAD BASE (must be done before module dependencies can be computed for later steps) graph = create_graph(cr, ['base'], force) if not graph: logger.notifyChannel('init', netsvc.LOG_CRITICAL, 'module base cannot be loaded! (hint: verify addons-path)') diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index 2e276433e63..fd701ba353e 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -200,6 +200,7 @@ class module(osv.osv): def _name_uniq_msg(self, cr, uid, ids, context=None): return _('The name of the module must be unique !') + def _certificate_uniq_msg(self, cr, uid, ids, context=None): return _('The certificate ID of the module must be unique !') @@ -285,8 +286,41 @@ class module(osv.osv): demo = demo or mdemo return demo + def upgrade(self, cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.module.module') + ids = mod_obj.search(cr, uid, [('state', 'in', ['to upgrade', 'to remove', 'to install'])]) + unmet_packages = [] + mod_dep_obj = self.pool.get('ir.module.module.dependency') + for mod in mod_obj.browse(cr, uid, ids, context=context): + depends_mod_ids = mod_dep_obj.search(cr, uid, [('module_id', '=', mod.id)], context=context) + for dep_mod in mod_dep_obj.browse(cr, uid, depends_mod_ids): + if dep_mod.state in ('unknown','uninstalled'): + unmet_packages.append(dep_mod.name) + if len(unmet_packages): + raise osv.except_osv(_('Unmet dependency !'), _('Following modules are not installed or unknown: %s') % ('\n\n' + '\n'.join(unmet_packages))) + mod_obj.download(cr, uid, ids, context=context) + cr.commit() + _db, pool = pooler.restart_pool(cr.dbname, update_module=True) + return True + 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) + self.upgrade(cr, uid, ids, context=context) + data_obj = self.pool.get('ir.model.data') + id2 = data_obj._get_id(cr, uid, 'base', 'view_base_module_upgrade_install') + if id2: + id2 = data_obj.browse(cr, uid, id2, context=context).res_id + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'base.module.upgrade', + 'views': [(id2, 'form')], + 'view_id': False, + 'type': 'ir.actions.act_window', + 'target': 'new', + 'nodestroy':True, + } + def button_install_cancel(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state': 'uninstalled', 'demo':False}) @@ -305,49 +339,41 @@ class module(osv.osv): res = cr.fetchall() 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'}) + self.upgrade(cr, uid, ids, context=context) return True def button_uninstall_cancel(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state': 'installed'}) return True + def button_upgrade(self, cr, uid, ids, context=None): depobj = self.pool.get('ir.module.module.dependency') todo = self.browse(cr, uid, ids, context=context) self.update_list(cr, uid) - i = 0 while i - - diff --git a/addons/base/static/test/list.js b/addons/base/static/test/list.js index 1a2b1719086..3d441f190db 100644 --- a/addons/base/static/test/list.js +++ b/addons/base/static/test/list.js @@ -149,7 +149,7 @@ $(document).ready(function () { listview.$element.find('tbody th input:eq(1)') .attr('checked', true); - listview.$element.find('#oe-list-delete').click(); + listview.$element.find('.oe-list-delete').click(); deepEqual(deleted, [2, 3]); }); }); From b49306e4458c850d7f13315800f1e98bc167a285 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Thu, 23 Jun 2011 17:44:03 +0530 Subject: [PATCH 380/442] [IMP] Base_setup:change help-menutip of Define default users preferences wizards- set values for all existing user and default values for each new user bzr revid: aag@tinyerp.co.in-20110623121403-fsh42481dkcegvpq --- addons/base_setup/base_setup_installer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml index ba1b1ad665c..fd72251eaa4 100644 --- a/addons/base_setup/base_setup_installer.xml +++ b/addons/base_setup/base_setup_installer.xml @@ -167,7 +167,7 @@ - Specify default values.This will set the default values for each new user, each user is free to change his own preferences. + Specify default values.This will set values for each existing users and set the default values for each new user, each user is free to change his own preferences. From 0afe868cb2ace2ac8e90ea8f46f7999ae1eb87b0 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Thu, 23 Jun 2011 18:04:12 +0530 Subject: [PATCH 381/442] [REM] Account:remove account_voucher field from Account installer confic wiz bcuse this field is avalabale in main Install Appl and this field not shown read only so need to remove from Accountin features bzr revid: aag@tinyerp.co.in-20110623123412-ohe63sds98lzrtej --- addons/account/account_installer.xml | 1 - addons/account/installer.py | 7 ------- 2 files changed, 8 deletions(-) diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml index ca8eb6d01e5..dd106e75afb 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -53,7 +53,6 @@ - diff --git a/addons/account/installer.py b/addons/account/installer.py index 26027573c27..c70821c1eee 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -257,18 +257,11 @@ class account_installer_modules(osv.osv_memory): help="Helps you generate reminder letters for unpaid invoices, " "including multiple levels of reminding and customized " "per-partner policies."), - 'account_voucher': fields.boolean('Voucher Management', - help="Account Voucher module includes all the basic requirements of " - "Voucher Entries for Bank, Cash, Sales, Purchase, Expenses, Contra, etc... "), 'account_anglo_saxon': fields.boolean('Anglo-Saxon Accounting', help="This module will support the Anglo-Saxons accounting methodology by " "changing the accounting logic with stock transactions."), } - _defaults = { - 'account_voucher': True, - } - account_installer_modules() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 1808b7d50a3cae8331ac0c8e1438c971d7c0477b Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Thu, 23 Jun 2011 18:07:55 +0530 Subject: [PATCH 382/442] [REM] association:remove project field from Associations Features bcuse this field is avalabale in main Install Appl and this field not shown read only so need to remove from Associations Features than in main Install App project is installed it will read only bzr revid: aag@tinyerp.co.in-20110623123755-ejgpsoj87oy3lf5p --- addons/association/profile_association.py | 3 --- addons/association/profile_association.xml | 1 - 2 files changed, 4 deletions(-) diff --git a/addons/association/profile_association.py b/addons/association/profile_association.py index 6aa3ebdd13d..8a528177a30 100644 --- a/addons/association/profile_association.py +++ b/addons/association/profile_association.py @@ -28,9 +28,6 @@ class profile_association_config_install_modules_wizard(osv.osv_memory): 'hr_expense':fields.boolean('Resources Management: Expenses Tracking', help="Tracks and manages employee expenses, and can " "automatically re-invoice clients if the expenses are " "project-related."), - 'project':fields.boolean('Project Management', - help="Helps you manage your projects and tasks by tracking them, " - "generating plannings, etc..."), 'event_project':fields.boolean('Event Management: Events', help="Helps you to manage and organize your events."), 'project_gtd':fields.boolean('Getting Things Done', help="GTD is a methodology to efficiently organise yourself and your tasks. This module fully integrates GTD principle with OpenERP's project management."), diff --git a/addons/association/profile_association.xml b/addons/association/profile_association.xml index 9147fd4ebc7..12222ecbd90 100644 --- a/addons/association/profile_association.xml +++ b/addons/association/profile_association.xml @@ -11,7 +11,6 @@ - From 52a6119cb4c1bc0f4b18507f25385ba03d7c7d3e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 23 Jun 2011 14:46:41 +0200 Subject: [PATCH 383/442] [ADD] list-level pagination on list views bzr revid: xmo@openerp.com-20110623124641-kzvkmx7fxe0xwn6w --- addons/base/static/src/js/list.js | 59 ++++++++++++++++++++++++++--- addons/base/static/src/xml/base.xml | 17 +++++---- 2 files changed, 63 insertions(+), 13 deletions(-) diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index 41a76d7c66f..e0bc3b5d340 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -167,8 +167,54 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi self.reload_view(); }); + this.$element.find('.oe-list-pager') + .delegate('button', 'click', function () { + var $this = $(this); + switch ($this.data('pager-action')) { + case 'first': + self.page = 0; break; + case 'last': + self.page = Math.floor( + self.dataset.ids.length / self.limit()); + break; + case 'next': + self.page += 1; break; + case 'previous': + self.page -= 1; break; + } + self.reload_content(); + }).find('.oe-pager-state') + .click(function (e) { + e.stopPropagation(); + // TODO: pagination setup thingie + }); + this.view_manager.sidebar.set_toolbar(data.fields_view.toolbar); }, + /** + * Configures the ListView pager based on the provided dataset's information + * + * Horrifying side-effect: sets the dataset's data on this.dataset? + * + * @param {openerp.base.DataSet} dataset + */ + configure_pager: function (dataset) { + this.dataset.ids = dataset.ids; + + var limit = this.limit(), + total = dataset.ids.length, + first = (this.page * limit), + last = ((total - first) < limit) ? total : first + limit; + this.$element.find('span.oe-pager-state').text(_.sprintf( + "[%d to %d] of %d", first + 1, last, total)); + + this.$element + .find('button[data-pager-action=first], button[data-pager-action=previous]') + .attr('disabled', this.page === 0) + .end() + .find('button[data-pager-action=last], button[data-pager-action=next]') + .attr('disabled', last === total); + }, /** * Sets up the listview's columns: merges view and fields data, move * grouped-by columns to the front of the columns list and make them all @@ -282,10 +328,8 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi */ reload_view: function (grouped) { var self = this; - this.dataset.offset = 0; - this.dataset.limit = false; var callback = function (field_view_get) { - self.on_loaded(field_view_get, grouped); + self.on_loaded(field_view_get, grouped); }; if (this.embedded_view) { return $.Deferred().then(callback).resolve({fields_view: this.embedded_view}); @@ -882,12 +926,15 @@ openerp.base.ListView.Groups = Class.extend( /** @lends openerp.base.ListView.Gr }); this.bind_child_events(list); - var limit = this.view.limit(), - d = new $.Deferred(); + var view = this.view, + limit = view.limit(), + d = new $.Deferred(); dataset.read_slice( _.filter(_.pluck(this.columns, 'name'), _.identity), - this.view.page * limit, limit, + view.page * limit, limit, function (records) { + view.configure_pager(dataset); + var form_records = _(records).map( $.proxy(list, 'transform_record')); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index 8bb9e2f3e76..1b077fa8aff 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -268,16 +268,19 @@ - - + - 1 - to 1 - of 1 + + - - + + From 57e5289d7774aa2120a4f22c2e51945fc016da16 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Thu, 23 Jun 2011 18:45:02 +0530 Subject: [PATCH 384/442] [ADD] Account: add account_voucher fields again bzr revid: aag@tinyerp.co.in-20110623131502-pe10s7pev3zhw8rh --- addons/account/installer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account/installer.py b/addons/account/installer.py index c70821c1eee..ed2f0501855 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -257,6 +257,9 @@ class account_installer_modules(osv.osv_memory): help="Helps you generate reminder letters for unpaid invoices, " "including multiple levels of reminding and customized " "per-partner policies."), + 'account_voucher': fields.boolean('Voucher Management', + help="Account Voucher module includes all the basic requirements of " + "Voucher Entries for Bank, Cash, Sales, Purchase, Expenses, Contra, etc... "), 'account_anglo_saxon': fields.boolean('Anglo-Saxon Accounting', help="This module will support the Anglo-Saxons accounting methodology by " "changing the accounting logic with stock transactions."), From 5f339ee830e75632a4585128a7d3445ab5eae190 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 23 Jun 2011 15:49:20 +0200 Subject: [PATCH 385/442] [IMP] page size switcher for list views, fix handling and display of pagination in case of unlimited page size (limit = (0 | undefined | null)) bzr revid: xmo@openerp.com-20110623134920-i8rfy4ggcb7kt7h4 --- addons/base/static/src/css/base.css | 3 +++ addons/base/static/src/js/list.js | 29 +++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index a921f320b3d..6f679d4b125 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -643,6 +643,9 @@ background: linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%, .openerp .oe-listview th.oe-list-pager { text-align: right; } +.openerp .oe-list-pager .oe-pager-state { + cursor: pointer; +} .openerp .oe-listview tfoot td { padding: 3px 3px 0; diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index e0bc3b5d340..060e5221d69 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -70,7 +70,7 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi * @returns {Number|null} */ limit: function () { - if (!this._limit) { + if (this._limit === undefined) { this._limit = (this.options.limit || this.defaults.limit || (this.view_manager.action || {}).limit @@ -186,7 +186,23 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi }).find('.oe-pager-state') .click(function (e) { e.stopPropagation(); - // TODO: pagination setup thingie + var $this = $(this); + + var $select = $('