[MERGE] merge small code imp
bzr revid: qdp-launchpad@openerp.com-20110704095809-t9s5y8cl62qky6cl
This commit is contained in:
@@ -81,13 +81,13 @@ class res_company(osv.osv):
|
||||
|
||||
def _get_address_data(self, cr, uid, ids, name, arg, context=None):
|
||||
result = {}
|
||||
part_obj = self.pool.get('res.partner')
|
||||
address_obj = self.pool.get('res.partner.address')
|
||||
for company in self.browse(cr, uid, ids, context=context):
|
||||
result[company.id] = {}
|
||||
for field in name:
|
||||
result[company.id][field] = False
|
||||
if company.partner_id:
|
||||
part_obj = self.pool.get('res.partner')
|
||||
address_obj = self.pool.get('res.partner.address')
|
||||
address_data = part_obj.address_get(cr, uid, [company.partner_id.id], adr_pref=['default'])
|
||||
if address_data['default']:
|
||||
address = address_obj.read(cr, uid, address_data['default'], [], context=context)
|
||||
|
||||
@@ -44,10 +44,9 @@ class res_config_configurable(osv.osv_memory):
|
||||
'''Return a description the current progress of configuration:
|
||||
a tuple of (non_open_todos:int, total_todos: int)
|
||||
'''
|
||||
return (self.pool.get('ir.actions.todo')\
|
||||
.search_count(cr, uid, [('state','<>','open')], context),
|
||||
self.pool.get('ir.actions.todo')\
|
||||
.search_count(cr, uid, [], context))
|
||||
todo_pool = self.pool.get('ir.actions.todo')
|
||||
return (todo_pool.search_count(cr, uid, [('state','<>','open')], context),
|
||||
todo_pool.search_count(cr, uid, [], context))
|
||||
|
||||
def _progress(self, cr, uid, context=None):
|
||||
closed, total = self.get_current_progress(cr, uid, context=context)
|
||||
@@ -116,8 +115,9 @@ class res_config_configurable(osv.osv_memory):
|
||||
return self.pool.get(current_user_menu.type).read(cr, uid, current_user_menu.id)
|
||||
|
||||
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):
|
||||
todo_pool = self.pool.get('ir.actions.todo')
|
||||
ids2 = todo_pool.search(cr, uid, [], context=context)
|
||||
for todo in todo_pool.browse(cr, uid, ids2, context=context):
|
||||
if (todo.type=='normal_recurring'):
|
||||
todo.write({'state':'open'})
|
||||
return self.next(cr, uid, ids, context)
|
||||
|
||||
Reference in New Issue
Block a user