--- ../Sorgente_openerp6/openobject-addons/account/account.py 2010-11-02 09:49:55.099368000 +0100 +++ ../Sorgente_openerp6/openobject-server/bin/addons/account/account.py 2010-11-25 09:52:47.436455721 +0100 @@ -615,10 +615,11 @@ } def write(self, cr, uid, ids, vals, context=None): - if 'company_id' in vals: - move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)]) - if move_lines: - raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines')) + for journal in self.browse(cr,uid,ids): + if 'company_id' in vals and journal.company_id.id != vals['company_id']: + move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)]) + if move_lines: + raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines')) return super(account_journal, self).write(cr, uid, ids, vals, context=context) def create_sequence(self, cr, uid, vals, context=None): @@ -710,8 +711,8 @@ res = {} - view_id = type_map.get(type, 'general') - + view_id = type_map.get(type, 'account_journal_view') + user = user_pool.browse(cr, uid, uid) if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency: view_id = 'account_journal_bank_view_multi'