From 1988d59fc2a2e11488b975558ed376f662b0fdeb Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Wed, 28 Jan 2009 21:33:13 +0100 Subject: [PATCH 1/6] [FIX] Typo obect -> object lp bug: https://launchpad.net/bugs/322464 fixed bzr revid: stephane@tinyerp.com-20090128203313-lcal91le01pk4d3v --- bin/addons/base/ir/ir_actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py index 3d42172e44d..312bd2db7e3 100644 --- a/bin/addons/base/ir/ir_actions.py +++ b/bin/addons/base/ir/ir_actions.py @@ -401,7 +401,7 @@ class actions_server(osv.osv): ], 'Action Type', required=True, size=32, help="Type of the Action that is to be executed"), 'code':fields.text('Python Code', help="Python code to be executed"), 'sequence': fields.integer('Sequence', help="Important when you deal with multiple actions, the execution order will be decided based on this, low number is higher priority."), - 'model_id': fields.many2one('ir.model', 'Object', required=True, help="Select the obect on which the action will work (read, write, create)."), + 'model_id': fields.many2one('ir.model', 'Object', required=True, help="Select the object on which the action will work (read, write, create)."), 'action_id': fields.many2one('ir.actions.actions', 'Client Action', help="Select the Action Window, Report, Wizard to be executed."), 'trigger_name': fields.selection(_select_signals, string='Trigger Name', size=128, help="Select the Signal name that is to be used as the trigger."), 'wkf_model_id': fields.many2one('ir.model', 'Workflow On', help="Workflow to be executed on this model."), From 41590f61ec0a7cd204456aac18cb0b702bea1855 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 29 Jan 2009 00:11:00 +0100 Subject: [PATCH 2/6] bugfix bzr revid: fp@tinyerp.com-20090128231100-lh55gi6k2rz57qcp --- bin/addons/base/res/partner/report/partner_address.xsl | 4 +++- bin/osv/orm.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/res/partner/report/partner_address.xsl b/bin/addons/base/res/partner/report/partner_address.xsl index 8661dec2b58..01fcc120c23 100644 --- a/bin/addons/base/res/partner/report/partner_address.xsl +++ b/bin/addons/base/res/partner/report/partner_address.xsl @@ -72,7 +72,9 @@ - + + + diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 5f74204aa62..5b85ba9d49e 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1381,6 +1381,7 @@ class orm(orm_template): for id in childs: pos2 = browse_rec(id[0], pos2) cr.execute('update '+self._table+' set parent_left=%s, parent_right=%s where id=%s', (pos,pos2,root)) + print 'Update', self._table, pos,pos2,root return pos2+1 query = 'SELECT id FROM '+self._table+' WHERE '+self._parent_name+' IS NULL' if self._parent_order: @@ -2302,6 +2303,7 @@ class orm(orm_template): parent_left<%s OR parent_right>%s; ''', (leftbound,rightbound,cwidth,cleft,cright,treeshift,leftbound,rightbound, cwidth,cleft,cright,treeshift,leftrange,rightrange)) + print 'Write Update' result = self._store_get_values(cr, user, ids, vals.keys(), context) for order, object, ids, fields in result: From 25e547a1150b7b41ee564a770c2b3d20e929f98a Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 29 Jan 2009 00:11:02 +0100 Subject: [PATCH 3/6] bugfix bzr revid: fp@tinyerp.com-20090128231102-t17un7qgmx0mmewh --- addons/mrp/report/price.xsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mrp/report/price.xsl b/addons/mrp/report/price.xsl index 0b5e90cff15..9f7dcf92fd8 100644 --- a/addons/mrp/report/price.xsl +++ b/addons/mrp/report/price.xsl @@ -93,7 +93,9 @@ - + + + From f876e7b2a4f175c85f5e57e9644bb6d54c71dde9 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 29 Jan 2009 00:46:35 +0100 Subject: [PATCH 4/6] bugfix bzr revid: fp@tinyerp.com-20090128234635-fq387ackvvl16xdo --- bin/tools/translate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 0dbc0183dd7..2b77c29de26 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -370,7 +370,7 @@ def trans_generate(lang, modules, dbname=None): def_params = { 'string': ('wizard_field', lambda s: [encode(s)]), - 'selection': ('selection', lambda s: [encode(e[1]) for e in (callable(s) and s(None, cr, uid, {}) or s)]), + 'selection': ('selection', lambda s: [encode(e[1]) for e in ((not callable(s)) and s or [])]), 'help': ('help', lambda s: [encode(s)]), } From a014326410b0e9bc596723893389ec1029ec9f80 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 29 Jan 2009 00:52:21 +0100 Subject: [PATCH 5/6] bugfix_no_translate_computed_selection bzr revid: fp@tinyerp.com-20090128235221-rntr7ic2btszu236 --- bin/wizard/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/wizard/__init__.py b/bin/wizard/__init__.py index a5e9aef3fe1..722fc686121 100644 --- a/bin/wizard/__init__.py +++ b/bin/wizard/__init__.py @@ -110,6 +110,11 @@ class interface(netsvc.Service): if not isinstance(fields[val]['selection'], (tuple, list)): fields[val] = copy.copy(fields[val]) fields[val]['selection'] = fields[val]['selection'](self, cr, uid, context) + elif lang: + res_name = "%s,%s,%s" % (self.wiz_name, state, field) + trans = lambda x: translate(cr, res_name, 'selection', lang, x) or x + for idx, (key, val2) in enumerate(fields[val]['selection']): + fields[field]['selection'][idx] = (key, trans(val2)) if lang: # translate fields @@ -119,11 +124,6 @@ class interface(netsvc.Service): trans = translate(cr, res_name, 'wizard_field', lang) if trans: fields[field]['string'] = trans - - if 'selection' in fields[field]: - trans = lambda x: translate(cr, res_name, 'selection', lang, x) or x - for idx, (key, val) in enumerate(fields[field]['selection']): - fields[field]['selection'][idx] = (key, trans(val)) if 'help' in fields[field]: t = translate(cr, res_name, 'help', lang, fields[field]['help']) From 2fdc099da6e27874e6e844a8f5cb0cc1fb639869 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 29 Jan 2009 00:55:50 +0100 Subject: [PATCH 6/6] modifs bzr revid: fp@tinyerp.com-20090128235550-567xltoy8x6ia785 --- addons/base_setup/wizard/wizard_base_setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/base_setup/wizard/wizard_base_setup.py b/addons/base_setup/wizard/wizard_base_setup.py index ac68dc09ecd..10c75bd092e 100644 --- a/addons/base_setup/wizard/wizard_base_setup.py +++ b/addons/base_setup/wizard/wizard_base_setup.py @@ -105,7 +105,7 @@ class wizard_base_setup(wizard.interface): module_obj=pooler.get_pool(cr.dbname).get('ir.module.module') ids=module_obj.search(cr, uid, [('category_id', '=', 'Profile'), ('state', '<>', 'uninstallable')]) - res=[(m.id, m.shortdesc) for m in module_obj.browse(cr, uid, ids)] + res=[(m.id, m.shortdesc) for m in module_obj.browse(cr, uid, ids, context=context)] res.append((-1, 'Minimal Profile')) res.sort() return res @@ -128,7 +128,7 @@ class wizard_base_setup(wizard.interface): pool=pooler.get_pool(cr.dbname) state_obj=pool.get('res.country.state') ids=state_obj.search(cr, uid, []) - res=[(state.id, state.name) for state in state_obj.browse(cr, uid, ids)] + res=[(state.id, state.name) for state in state_obj.browse(cr, uid, ids, context=context)] res.append((-1, '')) res.sort(lambda x,y: cmp(x[1],y[1])) return res @@ -137,7 +137,7 @@ class wizard_base_setup(wizard.interface): pool=pooler.get_pool(cr.dbname) country_obj=pool.get('res.country') ids=country_obj.search(cr, uid, []) - res=[(country.id, country.name) for country in country_obj.browse(cr, uid, ids)] + res=[(country.id, country.name) for country in country_obj.browse(cr, uid, ids, context=context)] res.sort(lambda x,y: cmp(x[1],y[1])) return res @@ -145,7 +145,7 @@ class wizard_base_setup(wizard.interface): pool=pooler.get_pool(cr.dbname) currency_obj=pool.get('res.currency') ids=currency_obj.search(cr, uid, []) - res=[(currency.id, currency.name) for currency in currency_obj.browse(cr, uid, ids)] + res=[(currency.id, currency.name) for currency in currency_obj.browse(cr, uid, ids, context=context)] res.sort(lambda x,y: cmp(x[1],y[1])) return res