[FIX] Account: user can't validate the invoice of an other company; patch included

lp bug: https://launchpad.net/bugs/651426 fixed

bzr revid: mra@mra-laptop-20101102093337-0diiqe2wmapc68i2
This commit is contained in:
Raphaël Valyi 2010-11-02 15:03:37 +05:30 committed by Mustufa Rangwala
parent 048486acec
commit ab38d5247d
1 changed files with 3 additions and 0 deletions

View File

@ -1101,6 +1101,9 @@ class account_move_line(osv.osv):
journal_obj = self.pool.get('account.journal')
if context is None:
context = {}
company_id = self.pool.get('account.move').read(cr, uid, vals['move_id'], ['company_id']).get('company_id', False)
if company_id:
vals['company_id'] = company_id[0]
self._check_date(cr, uid, vals, context, check)
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!'))