[MERGE] stock: fix the issue of counting of Deliveries

[MERGE] account: fix the KeyError in the lines of journal.entry

bzr revid: stw@openerp.com-20120906145520-twnqeb3wyezarcnx
This commit is contained in:
Stephane Wirtel 2012-09-06 16:55:20 +02:00
commit 58fe30e520
3 changed files with 3 additions and 3 deletions

View File

@ -1375,7 +1375,7 @@ class account_move(osv.osv):
balance = 0.0
for line in line_ids:
if line[2]:
balance += (line[2]['debit'] or 0.00)- (line[2]['credit'] or 0.00)
balance += (line[2].get('debit',0.00)- (line[2].get('credit',0.00)))
return {'value': {'balance': balance}}
def write(self, cr, uid, ids, vals, context=None):

View File

@ -57,7 +57,7 @@ class event_event(osv.osv):
ids = [ids]
res = []
for record in self.browse(cr, uid, ids, context=context)
for record in self.browse(cr, uid, ids, context=context):
date = record.date_begin.split(" ")[0]
date_end = record.date_end.split(" ")[0]
if date != date_end:

View File

@ -44,7 +44,7 @@ class product_product(osv.osv):
], ['product_id'], ['product_id'])
for move in moves:
product_id = move['product_id'][0]
res[product_id]['reception_count'] = move['product_id_count']
res[product_id]['delivery_count'] = move['product_id_count']
return res
def get_product_accounts(self, cr, uid, product_id, context=None):