Comment 0 for bug 1356382

Revision history for this message
Kinner Vachhani (kinner-vachhani) wrote :

[Pre-requisite]
* Multicompany module
* Accounting module

[steps to reproduce bug]
* Create bank statement for non base company
* Add statement line
* confirm statement line

[Traceback]
Error occurred while validating the field(s) company_id: Account and Period must belong to the same company.
Traceback (most recent call last):
  File "/home/openerp/7.0/server/openerp/netsvc.py", line 296, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/openerp/7.0/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/home/openerp/7.0/server/openerp/osv/osv.py", line 190, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/openerp/7.0/server/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/openerp/7.0/server/openerp/osv/osv.py", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/openerp/7.0/server/openerp/osv/osv.py", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/openerp/7.0/banking-addons/account_banking/banking_import_transaction.py", line 1562, in confirm
    statement_pool = self.pool.get('account.bank.statement')
  File "/home/openerp/7.0/banking-addons/account_banking/account_banking.py", line 405, in create_move_from_st_line
    context=localctx)
  File "/home/openerp/7.0/7.0-fixes/account_voucher/account_voucher.py", line 1645, in create_move_from_st_line
    return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line.id, company_currency_id, next_number, context=context)
  File "/home/openerp/7.0/7.0-fixes/account/account_bank_statement.py", line 359, in create_move_from_st_line
    move_line_id = account_move_line_obj.create(cr, uid, bank_move_vals, context=context)
  File "/home/openerp/7.0/7.0-fixes/account/account_move_line.py", line 1221, in create
    result = super(account_move_line, self).create(cr, uid, vals, context=context)
  File "/home/openerp/7.0/openerp-connector/connector/producer.py", line 42, in create
    record_id = create_original(self, cr, uid, vals, context=context)
  File "/home/openerp/7.0/server/openerp/osv/orm.py", line 4567, in create
    self._validate(cr, user, [id_new], context)
  File "/home/openerp/7.0/server/openerp/osv/orm.py", line 1581, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_osv: ('ValidateError', u'Error occurred while validating the field(s) company_id: Account and Period must belong to the same company.')