515
485
account_obj = self.pool.get('account.account')
516
486
account_move_line_obj = self.pool.get('account.move.line')
517
487
account_child_ids = account_obj.search(self.cr, self.uid, [('parent_id', 'child_of', self.ids)])
519
488
periods = self._get_periods()
524
492
account_move_line_ids = account_move_line_obj.search(self.cr, self.uid, [('account_id','in',account_child_ids),('date','<=',period.date_stop),('date','>=',period.date_start),('state','=','valid')],order='date')
494
account_move_line_ids = account_move_line_obj.search(self.cr, self.uid, [('id','in',account_move_line_ids),('product_id','=',self.product)])
525
495
for line in account_move_line_obj.browse(self.cr, self.uid, account_move_line_ids):
527
497
period_balance += line.debit - line.credit