--- account/account.py 2010-11-26 16:13:59 +0000 +++ account/account.py 2010-12-07 12:56:52 +0000 @@ -631,9 +631,12 @@ return super(account_journal, self).copy(cr, uid, id, default, context=context) def write(self, cr, uid, ids, vals, context=None): + c_id = None + for company in self.browse(cr,uid,ids): + c_id = company.company_id.id if 'company_id' in vals: move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)]) - if move_lines: + if move_lines and c_id and vals['company_id'] != c_id: 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)