[MERGE]
authorHarry (OpenERP) <hmo@tinyerp.com>
Tue, 26 Oct 2010 05:53:47 +0000 (11:23 +0530)
committerHarry (OpenERP) <hmo@tinyerp.com>
Tue, 26 Oct 2010 05:53:47 +0000 (11:23 +0530)
bzr revid: hmo@tinyerp.com-20101026055347-yxz72wusdbhty34e

1  2 
addons/account/account_cash_statement.py
addons/sale/sale.py

@@@ -241,10 -240,8 +240,10 @@@ class account_cash_statement(osv.osv)
       }
  
      def create(self, cr, uid, vals, context=None):
 +        if 'journal_id' not in vals:
 +            raise osv.except_osv('Error', _('You cannot create a bank or cash register without a journal!'))
          sql = [
-                 ('journal_id', '=', vals['journal_id']),
+                 ('journal_id', '=', vals.get('journal_id', False)),
                  ('state', '=', 'open')
          ]
          open_jrnl = self.search(cr, uid, sql)
Simple merge